yeshwanth
yeshwanth

Reputation: 1

embedding you tube video in html5 video tag

i want to embed you tube video in to HTML page by using html5 video tag. what i have done is

<video width="640" height="360" id="player1" preload="none">
    <source type="video/youtube" src="http://www.youtube.com/embed/ejjOfl_HRhc" />
</video>

but this code doesn't produce any result.

Upvotes: 0

Views: 3305

Answers (1)

Quentin
Quentin

Reputation: 943556

You have to:

  1. Use a MIME type supported by the browser (video/youtube is not a registered MIME type at all).
  2. Provide a URL to a video (http://www.youtube.com/embed/ejjOfl_HRhc is an HTML document).

YouTube probably don't want you hotlinking their video files and likely take steps to prevent it. You should use their official embedding code or host the videos yourself instead.

Upvotes: 1

Related Questions