Reputation: 451
I am using the following code to play a video inside my webpage. The player is shown with the image i have set,But the video doesnot play. Please anybody helps me:-
<video width="420"
height="340" poster="church.jpg" controls="controls" preload="none">
<!-- MP4 for Safari, IE9, iPhone, iPad, Android, and Windows Phone 7 -->
<source type="video/mp4"
src="http://www.youtube.com/watch?v=9wBvrp55KYM&feature=fvsr" />
<!-- WebM/VP8 for Firefox4, Opera, and Chrome -->
<source type="video/webm" src="myvideo.webm" />
<!-- Ogg/Vorbis for older Firefox and Opera versions -->
<source type="video/ogg" src="myvideo.ogv" />
<!-- Optional: Add subtitles for each language -->
<track kind="subtitles" src="subtitles.srt" srclang="en" />
<!-- Optional: Add chapters -->
<track kind="chapters" src="chapters.srt" srclang="en" />
<!-- Flash fallback for non-HTML5 browsers without JavaScript -->
<object width="320" height="240"
type="application/x-shockwave-flash" data="flashmediaelement.swf">
<param name="movie" value="flashmediaelement.swf" />
<param name="flashvars" value="
controls=true&file=http://www.youtube.com/watch?v=9wBvrp55KYM&feature=fvsr" />
<!-- Image as a last resort -->
<img src="church.jpg" width="320" height="240"
title="No video playback capabilities" />
</object></video>
Upvotes: 0
Views: 328
Reputation: 57690
If you want to play youtube video in your site, they provide embed code.
Read
Upvotes: 1
Reputation: 2126
The youtube link is a HTML site, NOT the actual MP4 video itself. So, due to this, it won't play. You'll have to link the ACTUAL FILE. Also, you do NOT include webm or ogg which makes this unusable in some browsers as well.
Upvotes: 1