html5 - How to play a YouTube video with HTML 5's <video> -


i can play youtube video in site using html 5 <video> controls?

i able run video mp4, ogg format,

<video width="710" height="423" controls>     <source src="testvideo.ogg" type="video/ogg">     browser not support video tag. </video> 

but how run teh video source youtube ex:

<video width="710" height="423" controls>   <source src="https://www.youtube.com/v/<youtube video id>?enablejsapi=1&rel=0&fs=1" type="????"></source>  browser not support video tag. </video> 

i provided valid source , given type video/youtube, got error no video supported format , mime type found

please let me know if have input

thanks, sharath

if tag

<youtube video id>  

produces 11 character code such video

https://www.youtube.com/watch?v=t2bylmlnyj8

the 11 character code t2bylmlnyj8

then think should try

<iframe width="710" height="423"      src="http://www.youtube.com/embed/<youtube video id>"> </iframe>  

it understanding youtube has taken on ensuring video format compatible device don't have worry method.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -