
插入视频的理想解决方法:
HTML5 + <object> + <embed>
登录后复制(视频教程推荐:html视频教程)
代码如下:
<!DOCTYPE html>
<html>
<body>
<video width="320" height="240" controls="controls" autoplay="autoplay">
<source src="/i/movie.ogg" type="video/ogg" />
<source src="/i/movie.mp4" type="video/mp4" />
<source src="/i/movie.webm" type="video/webm" />
<object data="/i/movie.mp4" width="320" height="240">
<embed width="320" height="240" src="/i/movie.swf" />
</object>
</video>
</body>
</html>登录后复制插入音频的理想解决方法:
<embed>
登录后复制下面的例子使用了两个不同的音频格式。Html5 <audio> 元素会尝试以 mp3 或 ogg 来播放音频。如果失败,代码将回退尝试 <embed> 元素。
<!DOCTYPE HTML>
<html>
<body>
<audio controls="controls">
<source src="/i/song.ogg" type="audio/ogg">
<source src="/i/song.mp3" type="audio/mpeg">
<embed height="100" width="100" src="/i/song.mp3" />
</audio>
</body>
</html>
登录后复制相关推荐:html教程
以上就是怎么在html中插入视频和音频的详细内容,更多请关注靠谱客其它相关文章!

最后
以上就是高兴曲奇最近收集整理的关于怎么在html中插入视频和音频的全部内容,更多相关怎么在html中插入视频和音频内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复