I'm trying to build a php video embedding function that parses the video URL automatically and then produces the right embed code out of that. I'm having trouble with the new blip.tv player because there is no reference the the video in the url that makes sense in the embed code. Here goes an example:
URL: http://blip.tv/NovusSwell/s3w31-hawaii-surfer-groms-with-potato-cannon-spud-gun-5471671
Embed Code:
<embed src="http://blip.tv/play/g8hQgs38GwI" type="application/x-shockwave-flash" width="550" height="327" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" ></embed>
g8hQgs38GwI is the video Id that I cannot guess out of the URL.
Is there a solution to this?
According to Blip.tv Wiki here's what you need to do:
Get the RSS version of the item: http://blip.tv/rss/view/5471671 (Get id from the URL).
Parse what you got at step 1 (RSS is basically an XML file): Using XPath, the copy/paste code is found at /rss/channel/item/media:player
Related
Hello guys how are you doing? Fine i hope.
Well i'm trying to make a non javascript version of a site and there is this swf client that runs by a javascript library which sets sizes and passes params.
Here is some code:
swfobject.embedSWF(KingGame._game_url, "flashContent", KingGame._flash_width, KingGame._flash_height, "10.0.0", false, {"param": KingGame._flash_params}, paramtrs);
This is the line where swfobject framework calls the swf and is passes this param to it which is an enormous xml file converted to a string i supose.
So now im trying to use something like:
<object width="1000" height="1000">
<param name="params" value="<?=urlencode($xml_config)?>">
<embed src="<?=$url?>" width="1000" height="1000">
</embed>
</object>
But it's not working i don't know how to pass this params with php or html, i'm searching but finding nothing, does anyone knows if that is possible at least?
Thanks
I'm trying to parse an embed tag from a video by Simple HTML DOM parser. I've spent 7 days to parse embed tag of this video, but until now I still can not parse embed tag from this video. I really don't understand why Simple HTML DOM parser can not parse this embed tag, the others tag it can parse easily.
file.php
include_once ("simple_html_dom.php");
$source = 'http://www.cliphai.com/2014/05/surprise-rollercoaster.html';
$html = file_get_html($source);
echo $html->find('embed',0);
Your website has this code:
<embed name="flashplayer" src="http://player.k24h.com/player.swf" flashvars="plugins=http://player.k24h.com/plugins/proxy.swf&proxy.link=http://www.youtube.com/v/gHmMszbgimY&autostart=true&controlbar.position=over" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" autostart="true" width="100%" height="100%" quality="low">
But it only appears when website is rendered, you won't find it in HTML.
Looks like just routes to youtube video http://www.youtube.com/v/gHmMszbgimY
There doesn't seem to be an <embed> tag in the source code of that page, so that's probably the reason why your DOM parser can't find it...
I am developing a web application with backend administration panel that allows users to insert video embedding code. This code will render the video on the corresponding page as i am echoing that code at that location.
The problem is that, when i echo the code, the code itself gets displayed instead of video being shown. Where i am going wrong?
Here is the code entered by user in the textarea in admin panel:
<pre>
<object id="vp110mFH" width="432" height="240" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"><param name="movie" value="http://static.animoto.com/swf/w.swf?w=swf/vp1&e=1340255540&f=10mFH15tm8Wyv1UT85DhEA&d=72&m=p&r=360p&volume=100&start_res=360p&i=m&ct=Click...To%20request%20more%20Info..&cu=http://schoolanduniversity.com/study_programs/more-information.php&options="></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed id="vp110mFH" src="http://static.animoto.com/swf/w.swf?w=swf/vp1&e=1340255540&f=10mFH15tm8Wyv1UT85DhEA&d=72&m=p&r=360p&volume=100&start_res=360p&i=m&ct=Click...To%20request%20more%20Info..&cu=http://schoolanduniversity.com/study_programs/more-information.php&options=" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="432" height="240"></embed></object>
</pre>
Please guide.
Regards,
Mrinal Purohit
It seems like you are displaying the html entities for your embed code, you could try using html_entity_decode() to get around this. Of course a better solution would be to store the embed code in the correct format, ie not encoded as entities.
So right now I can grab the url from already embedded soundcloud files in embed or iframe tags and use those urls on another page and display it in fancybox. Is there a way to get the right url or display in fancybox if a user offers a typical share url such as http://soundcloud.com/song-b/song-please or http://snd.sc/yp6VMo? I tried looking at the api documentation but I couldn't really find what I was looking for.
He is trying to get html to create a Soundcloud widget, not get the API url for a track. The oEmbed method "will serve the widget embed code for any SoundCloud URL pointing to a user, group, set or a playlist" and is recommended to make sure Soundclouds changes don't break your app (as opposed making your own Flash object or iframe). You can call it with a PHP web request to
http://soundcloud.com/oembed?format=js&url=[escaped_url]&iframe=true
Or with a JSON-P call (using jQuery for convenience)
$.getJSON('http://soundcloud.com/oembed?callback=?',
{format: 'js', url: 'http://snd.sc/yp6VMo', iframe: true},
function(data) {
// Stick the html content returned in the object into the page
$('#your_player_div').html(data['html'])
}
)
I'm adding iframe=true so you get the new HTML5 player, omit to get the old Flash object. It also works with the .sc short urls you are using.
you can try this for song url not for the id of song url
<iframe width="100%" height="166" scrolling="no" frameborder="no"src="http://w.soundcloud.com/player/?url=http://api.soundcloud.com/elissafranceschi/war&auto_play=false&color=915f33&theme_color=00FF00"></iframe>
I'm not exactly sure what you're asking here, but it sounds like you might need the "resolve" API endpoint. http://developers.soundcloud.com/docs/api/resolve
Example:
$ curl -v 'http://api.soundcloud.com/resolve.json?url=http://soundcloud.com/matas/hobnotropic&client_id=YOUR_CLIENT_ID'
HTTP/1.1 302 Moved Temporarily
Location: http://api.soundcloud.com/tracks/49931.json
This will give you all the track information and that should be enough for whatever you need to do. Also don't forget that there's the HTML5 widget too.
I haven't tried this, modified code from here:
<object height="81" width="100%">
<param name="movie" value="http://player.soundcloud.com/player.swf?url=<?php echo $url; ?>&g=bb"></param>
<param name="allowscriptaccess" value="always"></param>
<embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=<?php echo $url; ?>&g=bb" type="application/x-shockwave-flash" width="100%"></embed>
</object>
<?php echo $url; ?>
I have a PHP/jQuery scraper function that essentially looks for web page content.
One method looks for videos. When testing a youtube video page the video is scraped and is displayed just fine. Source code looks something like:
<embed width="320" height="240" bgcolor="#000000" allowfullscreen="true" allowscriptaccess="always" flashvars="account_playback_token=&ptk=KrebsCOHO%252Buser&enablecsi=1&iv_close_button=0&mpvid=AAS2NjXQtb70zY15&fexp=912208%2C914092%2C906423%2C901604&hl=en_GB&autohide=2&csi_page_type=watch5ad&keywords=Company+of+Heroes%2CCompany+of+Heroes+2%2CCOH+2%2CCOH%2CCOHO%2CCompany+of+Heroes+Online%2CvCOH%2CCommander%2CDefensive+Doctrine%2CAirborne+Doctrine%2CInfantry+Doctrine%2CBlitzkrieg+Doctrine%2CTerror+Doctrine%2CArmor+Doctrine%2CGenHansKrebs%2CKrebsCOHO%2CCompany+of+Heroes+Replays%2CCompany+of+Heroes+Casts%2CCompany+of+Heroes+Brits%2CCompany+of+Heroes+British%2CPanzer+Elite%2CTales+of+Valor%2COpposing+Fronts%2CCOH+Strategy%2CCompany+of+Heroes+Cheats%2CCompany+of+Heroes+Hacks&cr=GB&cc3_module=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswfbin%2Fsubtitles3_module-vflNKUm_s.swf&host_language=en&iv3_module=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswfbin%2Fiv3_module-vflVIYXve.swf&no_get_video_log=1&fmt_list=46%2F1920x1080%2F99%2F0%2F0%2C45%2F1280x720%2F99%2F0%2F0%2C22%2F1280x720%2F9%2F0%2F115%2C44%2F854x480%2F99%2F0%2F0%2C35%2F854x480%2F9%2F0%2F115%2C43%2F640x360%2F99%2F0%2F0%2C34%2F640x360%2F9%2F0%2F115%2C18%2F640x360%2F9%2F0%2F115%2C5%2F320x240%2F7%2F0%2F0&iv_storage_server=http%3A%2F%2Fwww.youtube.com%2Fannotations%2F&targeting_video_doc_id=&trueview=True&theme=tlb&ad_preroll=1&tk=A6fmSiw2bPJ1To1EkQ_GEhN5IQb7NH3SA2Lr7AmnDtyq0YRIw5HQFw%3D%3D&iv_load_policy=1&cc_font=Arial+Unicode+MS%2C+arial%2C+verdana%2C+_sans&watch_xlb=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fxlb%2Fwatch%2Fstrings-en_GB-vflXhsWkH.xlb&ad_channel_code_instream=afv_instream%2CVertical_Instream_8%2CVertical_Instream_41%2CVertical_Instream_933%2CVidVert8%2CVidVert41%2CVidVert933%2CVertical_8%2CVertical_41%2CVertical_933%2Cafv_instream_gb%2Cyt_mpvid_AAS2NjXQtb70zY15%2Cyt_cid_1640983%2Civp%2Cytexp_912208.914092.906423.901604%2Cytps_default%2Cytel_detailpage&sdetail=f%3Ag-u%2C&cafe_experiment_id=×tamp=1326243854&cc_asr=1&ad_host=ca-host-pub-6901191551304350&ad_eurl=http%3A%2F%2Fwww.youtube.com%2Fvideo%2F0LzC0V_6TfI&showpopout=1&url_encoded_fmt_stream_map=url%3Dhttp%253A%252F%252Fo-o.preferred.lhr14s15.v2.lscache4.c.youtube.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Csource%25252Cratebypass%25252Ccp%2526fexp%253D912208%25252C914092%25252C906423%25252C901604%2526itag%253D46%2526ip%253D95.0.0.0%2526signature%253DBB3EA0AD473B59EC8EE739170DFC4252629C04F1.A698AF6CCB326B05C6F31A687CB5C47003607517%2526sver%253D3%2526ratebypass%253Dyes%2526source%253Dyoutube%2526expire%253D1326268838%2526key%253Dyt1%2526ipbits%253D8%2526cp%253DU0hRS1JRVl9IUkNOMV9KS1pJOnVjQzhtUzNZVjVv%2526id%253Dd0bcc2d15ffa4df2%26quality%3Dhd1080%26fallback_host%3Dtc.v2.cache4.c.youtube.com%26type%3Dvideo%252Fwebm%253B%2Bcodecs%253D%2522vp8.0%252C%2Bvorbis%2522%26itag%3D46%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.lhr14s15.v22.lscache1.c.youtube.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Csource%25252Cratebypass%25252Ccp%2526fexp%253D912208%25252C914092%25252C906423%25252C901604%2526itag%253D45%2526ip%253D95.0.0.0%2526signature%253D9CA9C6F49F04CB131E4D3B9CFD12846CFA9E0C20.20C107ED1D2902332117EE528BB48DCB8A24D7CB%2526sver%253D3%2526ratebypass%253Dyes%2526source%253Dyoutube%2526expire%253D1326268838%2526key%253Dyt1%2526ipbits%253D8%2526cp%253DU0hRS1JRVl9IUkNOMV9KS1pJOnVjQzhtUzNZVjVv%2526id%253Dd0bcc2d15ffa4df2%26quality%3Dhd720%26fallback_host%3Dtc.v22.cache1.c.youtube.com%26type%3Dvideo%252Fwebm%253B%2Bcodecs%253D%2522vp8.0%252C%2Bvorbis%2522%26itag%3D45%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.lhr14s15.v1.lscache1.c.youtube.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Csource%25252Cratebypass%25252Ccp%2526fexp%253D912208%25252C914092%25252C906423%25252C901604%2526itag%253D22%2526ip%253D95.0.0.0%2526signature%253DB20BCC27B8113F47F66278E4208FE39BD53963C2.053298B3B43263F014DE8F65BE964D3815CB7683%2526sver%253D3%2526ratebypass%253Dyes%2526source%253Dyoutube%2526expire%253D1326268838%2526key%253Dyt1%2526ipbits%253D8%2526cp%253DU0hRS1JRVl9IUkNOMV9KS1pJOnVjQzhtUzNZVjVv%2526id%253Dd0bcc2d15ffa4df2%26quality%3Dhd720%26fallback_host%3Dtc.v1.cache1.c.youtube.com%26type%3Dvideo%252Fmp4%253B%2Bcodecs%253D%2522avc1.64001F%252C%2Bmp4a.40.2%2522%26itag%3D22%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.lhr14s15.v10.lscache8.c.youtube.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Csource%25252Cratebypass%25252Ccp%2526fexp%253D912208%25252C914092%25252C906423%25252C901604%2526itag%253D44%2526ip%253D95.0.0.0%2526signature%253D716B089CA9DFDB211533C46127FF2183118B8113.881E822D36F6CF39699C3BFAE2AFCF97B4BB9586%2526sver%253D3%2526ratebypass%253Dyes%2526source%253Dyoutube%2526expire%253D1326268838%2526key%253Dyt1%2526ipbits%253D8%2526cp%253DU0hRS1JRVl9IUkNOMV9KS1pJOnVjQzhtUzNZVjVv%2526id%253Dd0bcc2d15ffa4df2%26quality%3Dlarge%26fallback_host%3Dtc.v10.cache8.c.youtube.com%26type%3Dvideo%252Fwebm%253B%2Bcodecs%253D%2522vp8.0%252C%2Bvorbis%2522%26itag%3D44%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.lhr14s15.v14.lscache5.c.youtube.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Csource%25252Calgorithm%25252Cburst%25252Cfactor%25252Ccp%2526fexp%253D912208%25252C914092%25252C906423%25252C901604%2526algorithm%253Dthrottle-factor%2526itag%253D35%2526ip%253D95.0.0.0%2526burst%253D40%2526sver%253D3%2526signature%253D724A616F7861BC4BFF321FAC98F78FEF9F50183D.540D2E9D4E1772AE72CE68124A6BDCA3844E37FA%2526source%253Dyoutube%2526expire%253D1326268838%2526key%253Dyt1%2526ipbits%253D8%2526factor%253D1.25%2526cp%253DU0hRS1JRVl9IUkNOMV9KS1pJOnVjQzhtUzNZVjVv%2526id%253Dd0bcc2d15ffa4df2%26quality%3Dlarge%26fallback_host%3Dtc.v14.cache5.c.youtube.com%26type%3Dvideo%252Fx-flv%26itag%3D35%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.lhr14s15.v9.lscache2.c.youtube.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Csource%25252Cratebypass%25252Ccp%2526fexp%253D912208%25252C914092%25252C906423%25252C901604%2526itag%253D43%2526ip%253D95.0.0.0%2526signature%253D5690ED3BF298418A63A1FC3C88C958A68584195B.457E8F33852B796BECA5640EF06DC20DDE82154C%2526sver%253D3%2526ratebypass%253Dyes%2526source%253Dyoutube%2526expire%253D1326268838%2526key%253Dyt1%2526ipbits%253D8%2526cp%253DU0hRS1JRVl9IUkNOMV9KS1pJOnVjQzhtUzNZVjVv%2526id%253Dd0bcc2d15ffa4df2%26quality%3Dmedium%26fallback_host%3Dtc.v9.cache2.c.youtube.com%26type%3Dvideo%252Fwebm%253B%2Bcodecs%253D%2522vp8.0%252C%2Bvorbis%2522%26itag%3D43%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.lhr14s15.v6.lscache4.c.youtube.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Csource%25252Calgorithm%25252Cburst%25252Cfactor%25252Ccp%2526fexp%253D912208%25252C914092%25252C906423%25252C901604%2526algorithm%253Dthrottle-factor%2526itag%253D34%2526ip%253D95.0.0.0%2526burst%253D40%2526sver%253D3%2526signature%253D893DB716EDFB212C142092E4CDBCC0411D5F739F.ABE5CCCB87A14F189EF7CC5B09E5E9155FA42A4C%2526source%253Dyoutube%2526expire%253D1326268838%2526key%253Dyt1%2526ipbits%253D8%2526factor%253D1.25%2526cp%253DU0hRS1JRVl9IUkNOMV9KS1pJOnVjQzhtUzNZVjVv%2526id%253Dd0bcc2d15ffa4df2%26quality%3Dmedium%26fallback_host%3Dtc.v6.cache4.c.youtube.com%26type%3Dvideo%252Fx-flv%26itag%3D34%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.lhr14s15.v5.lscache4.c.youtube.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Csource%25252Cratebypass%25252Ccp%2526fexp%253D912208%25252C914092%25252C906423%25252C901604%2526itag%253D18%2526ip%253D95.0.0.0%2526signature%253D961584FFF0C062FAD18B1D50B608148227664DB6.0BE5C5579A29A79168BBFD3356A60CA015603F10%2526sver%253D3%2526ratebypass%253Dyes%2526source%253Dyoutube%2526expire%253D1326268838%2526key%253Dyt1%2526ipbits%253D8%2526cp%253DU0hRS1JRVl9IUkNOMV9KS1pJOnVjQzhtUzNZVjVv%2526id%253Dd0bcc2d15ffa4df2%26quality%3Dmedium%26fallback_host%3Dtc.v5.cache4.c.youtube.com%26type%3Dvideo%252Fmp4%253B%2Bcodecs%253D%2522avc1.42001E%252C%2Bmp4a.40.2%2522%26itag%3D18%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.lhr14s15.v21.lscache4.c.youtube.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Csource%25252Calgorithm%25252Cburst%25252Cfactor%25252Ccp%2526fexp%253D912208%25252C914092%25252C906423%25252C901604%2526algorithm%253Dthrottle-factor%2526itag%253D5%2526ip%253D95.0.0.0%2526burst%253D40%2526sver%253D3%2526signature%253DA9B71D32C230E1F299E367D90AFA645A5D5E80A0.7E100FAA814386C7560B9657AA6932F2D8983458%2526source%253Dyoutube%2526expire%253D1326268838%2526key%253Dyt1%2526ipbits%253D8%2526factor%253D1.25%2526cp%253DU0hRS1JRVl9IUkNOMV9KS1pJOnVjQzhtUzNZVjVv%2526id%253Dd0bcc2d15ffa4df2%26quality%3Dsmall%26fallback_host%3Dtc.v21.cache4.c.youtube.com%26type%3Dvideo%252Fx-flv%26itag%3D5&tmi=1&iv_logging_level=3&ad_flags=0&endscreen_module=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswfbin%2Fendscreen-vfl6o3XZn.swf&cid=1640983&referrer=None&afv_instream_max=20000&ad_logging_flag=1&t=vjVQa1PpcFPtL2KNy9BlI1YWfqrxIuH0Q7IxA2lS4fY%3D&sffb=True&ttsurl=http%3A%2F%2Fwww.youtube.com%2Fapi%2Ftimedtext%3Fsparams%3Dasr_langs%252Ccaps%252Cexpire%252Cv%26asr_langs%3Den%252Cko%252Cja%26caps%3Dasr%26expire%3D1326268800%26key%3Dyttt1%26signature%3D08601E0AFAF4E565C284D451574665CE892A187A.C3A7BCC212D929F08BA9FB37BA1FA706CE8B408B%26hl%3Den-GB&aftv=True&creator=KrebsCOHO&allow_embed=1&ad_host_tier=2902314&rvs=view_count%3D1%252C978%26author%3DKrebsCOHO%26length_seconds%3D2153%26id%3D51if2_4DyoY%26title%3DCompany%2Bof%2BHeroes%2B%252395%2B-%2BGuess%2BWho%2527s%2BBack%2Cview_count%3D1%252C287%26author%3DKrebsCOHO%26length_seconds%3D2128%26id%3DnpOGF24Xun0%26title%3DBattlefield%2B3%2B%25239%2B-%2BThe%2BAmazing%2BBack%2Bto%2BKarkand%2Cview_count%3D2%252C386%26author%3DKrebsCOHO%26length_seconds%3D2913%26id%3Dc91SxbW5RTI%26title%3D%255BCOH%255D%2B%252382%2B-%2BOne%2BMove%2Bto%2BChange%2Bit%2BAll%2Cview_count%3D1%252C337%26author%3Dfrewd100%26length_seconds%3D1555%26id%3DsgxLZTsoZEk%26title%3DCompany%2Bof%2BHeroes%2B3v3%2BOnline%2BBattle%2BRefinery%2B%25281%252F2%2529%2Cview_count%3D3%252C077%26author%3DKrebsCOHO%26length_seconds%3D3400%26id%3D5fHOapLYenQ%26title%3DCompany%2Bof%2BHeroes%2B%252397%2B-%2BEurope%2BIn%2BRuins%2BShowcase%2Cview_count%3D27%252C804%26author%3DEvolvSports%26length_seconds%3D351%26id%3DP4y5fdDZH60%26title%3DChris%2BSharma%2Band%2BMatt%2BSegal%2Bon%2Bthe%2BShaman%2Cview_count%3D2%252C037%26author%3DKrebsCOHO%26length_seconds%3D2569%26id%3DolWg5hYRv0o%26title%3DCompany%2Bof%2BHeroes%2B%252393%2B-%2BValiant%2BSacrifices%2Cview_count%3D255%252C178%26author%3DTheIllustrationArt%26length_seconds%3D180%26id%3DbN1_h_eGitE%26title%3DThe%2BTale%2Bof%2Bthe%2BThree%2BBrothers%2B%2528HD%2529%2Cview_count%3D4%252C312%26author%3DKrebsCOHO%26length_seconds%3D2418%26id%3DG1Isd6SM8aM%26title%3D%255BCOH%255D%2B%252374%2B-%2BLevel%2B20%2BWehrmacht%2Cview_count%3D7%252C734%26author%3DVorbeugungshaft%26length_seconds%3D292%26id%3DEO7NIzsBf44%26title%3DLeger%2Bdes%2BHeils%2B-%2BDer%2BGott%252C%2Bder%2BEisen%2Bwachsen%2Blie%25C3%259F%2Cview_count%3D153%252C325%26author%3DSarahFan0503%26length_seconds%3D338%26id%3DAnUVqu4CYus%26title%3DSarah%2BConnor%2B-%2B%2522Christmas%2BIn%2BMy%2BHeart%2522%2BLIVE%2B%2540%2BThe%2BChristmas%2BSpecial%2B2005%2Cview_count%3D23%252C660%26author%3DTriple6Games%26length_seconds%3D428%26id%3DEPUYh57VlH8%26title%3DTropico%2B4-PC%2BGameplay%2BHD%2BMaxed%2BOut&vq=auto&iv_enabled_features=TCS&sendtmp=1&ad3_module=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswfbin%2Fad3-vfly6I_ZM.swf&gut_tag=%2F4061%2Fytunknown%2Fmain&ptchn=KrebsCOHO&as_launched_in_country=1&length_seconds=2779&feature=g-u&enablejsapi=1&plid=AAS2NjXP5DaZ4rS5&iv_module=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswfbin%2Fiv_module-vflBrKDBK.swf&afv=True&ad_video_pub_id=ca-pub-6219811747049371&ad_slots=0&watermark=%2Chttp%3A%2F%2Fs.ytimg.com%2Fyt%2Fimg%2Fwatermark%2Fyoutube_watermark-vflHX6b6E.png%2Chttp%3A%2F%2Fs.ytimg.com%2Fyt%2Fimg%2Fwatermark%2Fyoutube_hd_watermark-vflAzLcD6.png&supersizefeatured=1&oid=oyMOP28xy70&cc_module=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswfbin%2Fsubtitle_module-vfld45BNe.swf&ad_channel_code_overlay=invideo_overlay_480x70_cat20%2Cafv_overlay%2CVertical_Overlay_8%2CVertical_Overlay_41%2CVertical_Overlay_933%2CVidVert8%2CVidVert41%2CVidVert933%2CVertical_8%2CVertical_41%2CVertical_933%2Cyt_mpvid_AAS2NjXQtb70zY15%2Cyt_cid_1640983%2Civp%2Cytexp_912208.914092.906423.901604%2Cytps_default%2Cytel_detailpage&pyv_in_related_cafe_experiment_id=&video_id=0LzC0V_6TfI&sk=KGM0UWVabLqnTDH6CGaGWIPrk8jgepgiC" id="movie_player" src="http://s.ytimg.com/yt/swfbin/watch_as3-vfl7SkMGe.swf" type="application/x-shockwave-flash">
What I would like to know is, how can I stop this video from autoplaying? I have tried various ways of adding autoplay=0 after the src etc with no luck.
Has anyone had experience with the method I'm using? Is it technically viable?
Thanks
You are over-complicating things, You should grab the youtube video ID with a little regex:
if(preg_match('/(?<=video_id=).*?(?=&|")/',$str,$matches)){
$video_id = $matches[0];
}
And then use it to create the real embed code:
$youtube = '<iframe width="853" height="480" src="http://www.youtube.com/embed/'.$video_id.'?hd=1" frameborder="0" allowfullscreen></iframe>'
And then it never auto-plays
try by adding the following to the URL variables:
&autoplay=0