EQnoble
Well-known member
EQnoble submitted a new resource: BBcode MediaSites Package
Addon to install a bunch of MediaSites and supporting files
Read more
Addon to install a bunch of MediaSites and supporting files
Read more
Have fixed this for the next updateViddler not embedding http://www.viddler.com/v/7efc35c2
There will be a thread created at some point today entirely for this purpose I just need to gather a bunch of data and post it up before I can create it (Basically the complete working list of codes for those that don't want to use the addon) but once the list is complete at the top of the thread it will be used as the support thread for sites in this addon and all other sites as well. I will do that before I go to sleep tonight.I'm not sure if this is the right place to post these now, so feel free to move it or tell me where to repost it if necessary. There's an HTML5 version of the SoundCloud widget (see here) that I can't seem to get working. The Match URLs should be the same as the Flash version, but the Embed HTML is obviously different. I'm just stuck figuring out where to put the {$id} and do it so that I don't have to go back through and update all of my old embeds (i.e. I'd just update my current SoundCloud BB code and it would update the embeds automatically, since the URLs didn't change).
#http://soundcloud\.com/(?P<id>[\-a-z0-9_]+/[\-a-z0-9_]+)$#siU
#(?P<id>soundcloud\.com/(([a-z0-9-_]+/[a-z0-9-_]+/[a-z0-9-_]+)|([a-z0-9-_]+/[a-z0-9-_]+)))#si
#(?P<id>snd\.sc/[a-z0-9]+)#si
<?php
class MediaSites_Soundcloud
{
public static function buildEmbed($mediaKey, array $site)
{
$pageHtml = file_get_contents( 'http://' . $mediaKey );
if(preg_match('#<meta.+player.swf\?url=.+tracks%2F(?P<scid>[0-9]+)#i', $pageHtml, $match))
{
$embedHtml = '<iframe width="100%" height="166" class="html5player" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F__MEDIAKEY__&show_artwork=true"></iframe>';
$finalHtml = str_replace('__MEDIAKEY__', $match['scid'], $embedHtml);
return $finalHtml;
}
elseif(preg_match('#<meta.+player.swf\?url=.+playlists%2F(?P<scid>[0-9]+)#i', $pageHtml, $match))
{
$embedHtml = '<iframe width="100%" height="450" class="html5player" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F__MEDIAKEY__&show_artwork=true"></iframe>';
$finalHtml = str_replace('__MEDIAKEY__', $match['scid'], $embedHtml);
return $finalHtml;
}
elseif(preg_match('#<meta.+player.swf\?url=.+users%2F(?P<scid>[0-9]+)#i', $pageHtml, $match))
{
$embedHtml = '<iframe width="100%" height="450" class="html5player" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Fusers%2F__MEDIAKEY__&show_artwork=true"></iframe>';
$finalHtml = str_replace('__MEDIAKEY__', $match['scid'], $embedHtml);
return $finalHtml;
}
else return '<a href="http://' . $mediaKey . '">http://' . $mediaKey . '</a>';
}
}
[media=twitter]179368126859853824[/media]
[media=soundcloud]soundcloud.com/kasabianofficial/table-tennis-boom-box[/media]
Can anybody get embed videos and livestream from twitch.tv/justin.tv? Thanks.
We use essential cookies to make this site work, and optional cookies to enhance your experience.