Cujo
Member
Is embedding TrailerAddict video's possible with the new XF 1.1 system? I had a go at it, but I did not manage to get it working. Example video: http://www.traileraddict.com/trailer/hugo/trailer
That's the old player, not the new HTML5 player though
Yup thanks to Jake I got this working today...Is embedding TrailerAddict video's possible with the new XF 1.1 system? I had a go at it, but I did not manage to get it working. Example video: http://www.traileraddict.com/trailer/hugo/trailer
<?php
class MediaSites_TrailerAddict
{
public static function buildEmbed($mediaKey, array $site)
{
// CAPTURE WEB PAGE
$pageHtml = file_get_contents('http://traileraddict.com/' . $mediaKey );
// ISOLATE THE TRAILER ID FROM THE META TAG
if(preg_match('#<meta property="og:video" content="http://www\.traileraddict\.com/emd/(?P<trailerid>[0-9]+)" />#si', $pageHtml, $match))
{
// DEFINE GENERIC EMBED HTML WITH REPLACEMENT VARIABLE __MEDIAKEY__
$embedHtml = '<object width="450" height="245">
<param name="movie" value="http://www.traileraddict.com/emd/__MEDIAKEY__"></param>
<param name="allowscriptaccess" value="always"><param name="wmode" value="transparent"></param>
<param name="allowFullScreen" value="true"></param>
<embed src="http://www.traileraddict.com/emd/__MEDIAKEY__" type="application/x-shockwave-flash" allowscriptaccess="always" wmode="transparent" width="450" height="245" allowFullScreen="true"></embed>
</object>';
// MAKE THE REPLACEMENTS
$finalHtml = str_replace('__MEDIAKEY__', $match['trailerid'], $embedHtml);
// RETURN THE FINISHED HTML
return $finalHtml;
}
// RETURN NOTHING IF NO MATCH
return '';
}
}
Thank you, I got it working with your help.made one small edit to the code above:
use this..
Match URLs: #http://www\.traileraddict\.com/(?P<id>trailer/[a-z0-9\-] /(trailer|blu-ray-trailer))#siU
Thank you, I got it working with your help.
However, I find the regular expression you used a little limiting. What about this one, it should let you embed ALL Traileraddict video's:
Match URLs: #http://www\.traileraddict\.com/(?P<id>trailer/[\-a-z0-9_]+/[\-a-z0-9_]+)(\?.*)?$#siU
Do you know if TrailerAddict has any other types of trailers other than trailer or blu-ray-trailer?
<div>
<object width="100%" height="500">
<param name="movie" value="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf?feed=http://www.mixcloud.com/{$id}/{$id2}/&embed_uuid=e08df691-ef32-4f91-bd60-de7107899216&embed_type=widget_standard">
<param name="allowFullScreen" value="true"><param name="wmode" value="opaque">
<param name="allowscriptaccess" value="always">
<embed src="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf?feed=http://www.mixcloud.com/{$id}/{$id2}/&embed_uuid=e08df691-ef32-4f91-bd60-de7107899216&embed_type=widget_standard" type="application/x-shockwave-flash" wmode="opaque" allowscriptaccess="always" allowfullscreen="true" width="100%" height="500"></object>
<div>
<object width="100%" height="500">
<param name="movie" value="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf?feed=http://www.mixcloud.com/{$id}&embed_uuid=e08df691-ef32-4f91-bd60-de7107899216&embed_type=widget_standard">
<param name="allowFullScreen" value="true"><param name="wmode" value="opaque">
<param name="allowscriptaccess" value="always">
<embed src="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf?feed=http://www.mixcloud.com/{$id}&embed_uuid=e08df691-ef32-4f91-bd60-de7107899216&embed_type=widget_standard" type="application/x-shockwave-flash" wmode="opaque" allowscriptaccess="always" allowfullscreen="true" width="100%" height="500"></object>
[media=mixcloud]aboveandbeyond/above-beyond-tatw-400-live-in-beirut/[/media]
#http://www\.mixcloud\.com/(?P<id>[\-a-z0-9_]+/[\-a-z0-9_]+/)$#siU
Very cool.I decided to try something here.
dorkly.com/video/{$id:alphanum}/
<object id="dorkly{$id}" type="application/x-shockwave-flash" data="http://www.dorkly.com/moogaloop/noobtube.swf?clip_id={$id}&use_node_id=true&fullscreen=1" width="600" height="338"><param name="allowfullscreen" value="true"/>
<param name="wmode" value="transparent"/>
<param name="allowScriptAccess" value="always"/>
<param name="movie" quality="best" value="http://www.dorkly.com/moogaloop/noobtube.swf?clip_id={$id}&use_node_id=true&fullscreen=1"/>
<embed src="http://www.dorkly.com/moogaloop/noobtube.swf?clip_id={$id}&use_node_id=true&fullscreen=1" type="application/x-shockwave-flash" wmode="transparent" width="600" height="338" allowScriptAccess="always">
</embed>
</object>
funnyordie.com/videos/{$id:alphanum}/
<iframe src="http://www.funnyordie.com/embed/{$id}" width="640" height="400" frameborder="0"></iframe>
We use essential cookies to make this site work, and optional cookies to enhance your experience.