So I have a HTML5 video player that works fine with a direct url as the source. However when I set the source as a url that links to a direct url, it won't work. Is there anyway to make it work? I am using PHP if that helps.
<video src="<?php echo $link; ?>" width="640" height="360" poster="testy/vplayer/media/poster.jpg" tabindex="0" controls="controls"></video>
The link is
http://redirector.googlevideo.com/videoplayback?id=ff1c9d4cf38db476&itag=18&source=picasa&cmo=sensitive_content=yes&ip=0.0.0.0&ipbits=0&expire=1387666335&sparams=id,itag,source,ip,ipbits,expire&signature=517DDFA9BB4265FC0E36CD19B7AEF96030DEF3BF.BDC3F29A59A031DC805381CDA22357227A7B4624&key=lh1
Related
I want to use Google vrview-web using this example: googlevrview
How can I set src attribute in iframe tag?
Below is the example given in the link:
<iframe width="100%" scrolling="yes" allowfullscreen src="https://storage.googleapis.com/vrview/examples/video/index.html?video=examples/video/congo_2048.mp4&is_stereo=true"></iframe>
Now I have to set my video URL in src like below:
<iframe width="100%" scrolling="yes" allowfullscreen src="<?php echo VIDEO_URL.$data["video"]; ?>&is_stereo=true"></iframe>
It does not display the video.
if I use below iframe tag:
<iframe width="100%" scrolling="yes" allowfullscreen src="https://storage.googleapis.com/vrview/examples/video/index.html?video=MY_VIDEO&is_stereo=true"></iframe>
Still, it prints this data in my page:
Output
Assuming that the VIDEO_URL hold this:
https://storage.googleapis.com/vrview/examples/video/index.html?video=
Your iframe can't just print the HTML. Please inspect your rendered HTML/DOM or iframe src value is proper and not broken.
Moreover it is required that your website, where the videos are, allows CORS. Cross origin resource sharing. Otherwise the Google's script won't load your video inside the iframe in VR mode.
I want to play youtube video link on my php page
youtube link is
https://www.youtube.com/watch?v=VAJK04HOLd0
<object width="420" height="315" data="https://www.youtube.com/watch?v=VAJK04HOLd0">
i am try this code but it's not working
You can load the video file in <iframe>. Try this sample code,
<iframe width="560" height="315" src="https://www.youtube.com/embed/VAJK04HOLd0" frameborder="0" allowfullscreen></iframe>
Look at the last part of the url https://www.youtube.com/embed/VAJK04HOLd0,
VAJK04HOLd0
Which is the youtube video code. If you want to change the video change the code.
To embed YouTube videos, you should be using an iframe.
<iframe id="ytplayer" type="text/html" width="640" height="390" src="http://example.com/?autoplay=1" frameborder="0"/>
It's not connected to php.
You will want to include &autoplay=1 to the youtube string.
So I have a video player with the following source code.
<video width="320" height="240" controls>
<source src=<?php echo $tryOne; ?> type="video/mp4">
</video>
It will echo something something similar to below and insert it as the source video.
'176.227.210.66/Kuroko%20no%20Basket%202%20Episode%205.mp4?st=zEws3h1Xg-to07f3as6KqA&e=1385059955'
However, the player will not load the the video. If I open page source and copy the generate url into the address bar and hit enter, it will go to the direct url and load the video just fine. I think that the player won't load the url because it has GET variables in it, and I need to know how to fix this. Please tell me how I can load a video in a player from the above url with GET variables.
Note: the player will load a video just fine if it is named without the get variables.
As per the HTML specification for <video>, you need a valid URL:
src = non-empty URL potentially surrounded by spaces.
The URL for the video.
In this case, it is missing the protocol information (http://) and it is not being recognized as a video src. Change the value of $tryOne to include the protocol information or manually prepend it to the variable when outputting to the page. It might also be a good idea to URL-encode the string.
For example:
<video width="320" height="240" controls>
<source src=<?php echo 'http://'.urlencode($tryOne); ?> type="video/mp4">
</video>
Live demo.
I'm trying to keep a database of posted videos on a site I am currently developing. To be able to do this I have to store the URLs of the videos into a database and then I call the url from the database using php and sql by doing this bare in mind I am using this from a php defined area on my homepage. If I use this code it works on other video post sites!
echo '<iframe width="640" height="390" src="', $row['Post_URL'],'"frameborder="0" allowFullScreen></iframe>';
This will not work it says content cannot be displayed in a frame but if I do this it works.
<?php
echo '<iframe width="560" height="315" src="http://www.youtube.com/embed/wardQ7W8hPU" frameborder="0" allowfullscreen></iframe>';
?>
why does the one work properly and the other not? what is a way around this so I can call from the database into php and echo it out so it will display properly on the page?
I got the same problem today. As stated in one of the comments, the problem is the url used...
The iframe embed only works with urls looking like:
http://www.youtube.com/embed/[video_id]
Most of people are using the "share" feature, that generates minified urls like:
http://youtu.be/[video_id]
However, if you look into the "embed" feature, you'll notice that it generates an iframe with src urls like the first example.
So to answer the question, when using iframes to embed, use the src url like the first example.
Try this
<iframe width="640" height="390" src="<?php echo $row['Post_URL'] ?>" frameborder="0" allowFullScreen></iframe>
OR this
<?php
echo "<iframe width='640' height='390' src='{$row['Post_URL']}' frameborder='0' allowFullScreen></iframe>";
?>
OR this
<?php
echo "<iframe width='640' height='390' src='" . $row['Post_URL'] . "' frameborder='0' allowFullScreen></iframe>";
?>
they all are the same and will do the same process.
I'm doing this with dynamic data and it's easier for the client to use the youtube Share link.
So... it's then just a matter of getting the youtube video ID from that url.
// we can't use the "share" link so need to just get the video ID
$youtubePath = parse_url($youtubeShareLink,PHP_URL_PATH);
$youtubeId = str_replace('/','',$youtubePath);
and now we can use the ID in an iframe (adjust width and height per embed options in youtube)
<iframe width="560" height="315" src="//www.youtube.com/embed/<? echo $youtubeId; ?>?rel=0" frameborder="0" allowfullscreen></iframe>
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