在 HTML 中播放视频的方法有很多种。
使用 <embed> 标签
<embed> 标签的作用是在 HTML 页面中嵌入多媒体元素。
<embed src="movie.swf" height="200" width="200"/>注释:显示嵌入网页的 Flash 视频。如果浏览器不支持 Flash,那么视频将无法播放。
<object data="movie.swf" height="200" width="200"/>
<video width="320" height="240" controls="controls"> <source src="movie.mp4" type="video/mp4" /> <source src="movie.ogg" type="video/ogg" /> <source src="movie.webm" type="video/webm" /> Your browser does not support the video tag. </video>
<video width="320" height="240" controls="controls"> <source src="movie.mp4" type="video/mp4" /> <source src="movie.ogg" type="video/ogg" /> <source src="movie.webm" type="video/webm" /> <object data="movie.mp4" width="320" height="240"> <embed src="movie.swf" width="320" height="240" /> </object> </video>注释:本实例中使用了 4 中不同的视频格式。
<embed src="http://player.youku.com/player.php/sid/XMzI2NTc4NTMy/v.swf" width="480" height="400" type="application/x-shockwave-flash"></embed>
<a href="movie.avi">Play a video file</a>注释:用户点击链接,浏览器会启动“辅助应用程序”如 Windows Media Player 来播放。
评论