Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Embed Youtube Videos into HTML5 <video> Tag?

I am implementing site where i required to embed youtube videos into tag in HTML5. can you tell me how should i embedd into this without using <iframe>

like image 975
Rishi Jogle Avatar asked Nov 01 '12 12:11

Rishi Jogle


2 Answers

There's no way to do this without Javascript. But the wonderful MediaElement.js library will work wonderfully for this purpose:

http://mediaelementjs.com

The example above shows using a YouTube video with a <video> tag, but also has a fallback to Flash for browsers that don't support it.

like image 56
kinabalu Avatar answered Nov 15 '22 18:11

kinabalu


You can't extract the source of the video without violating YouTube's terms of service. The only supported way to embed a video in a web page is using the iframe embed.

like image 41
Greg Schechter Avatar answered Nov 15 '22 17:11

Greg Schechter