一、网页中插入视频
<!doctype html>
<
html
>
<
head
>
<
meta
charset
=
"utf-8"
>
<
title
>网页视频测试</
title
>
</
head
>
<
body
>
<
div
align
=
"center"
>
<
embed
src
=
"http://player.youku.com/player.php/Type/Folder/Fid/22127316/Ob/1/sid/XNjk1MDUyNzU2/v.swf"
quality
=
"high"
width
=
"500"
height
=
"440"
align
=
"center"
allowScriptAccess
=
"always"
allowFullScreen
=
"true"
mode
=
"transparent"
type
=
"application/x-shockwave-flash"
></
embed
>
</
div
>
</
body
>
</
html
>
方法二(通用代码适用于手机页面播放 推荐):
<iframe src="http://localhost/2012/mayday2012.mp4" scrolling="no" allowfullscreen="" frameborder="0" height="418" width="675"></iframe>
方法三:html5
由于旧的浏览器和Internet Explorer不支持<video>元素,考虑到兼容性,我们必须为这些浏览器找到一个支持Flash文件的解决方案。不幸的是,和HTML 5音频一样,涉及到视频的文件格式,Firefox 和 Safari/Chrome 的支持方式并不相同。因此,如果你想在这个时候使用HTML 5视频,则需要创建三个视频版本。
|
< video controls = "controls" preload = "auto" height = "500" width = "700" > <!-- Firefox --> < source src = "mv.ogg" type = "video/ogg" /> <!-- Safari/Chrome--> < source src = "mv.mp4" type = "video/mp4" /> <!-- 如果浏览器不支持video标签,则使用flash --> < embed src = "mv.mp4" type = "application/x-shockwave-flash" width = "1024" height = "798" allowscriptaccess = "always" allowfullscreen = "true" > </ embed > </ video > |