我正在尝试在HTML5样板中实现videoJS。我尝试粘贴videoJS建议的嵌入代码,但结果不起作用。当页面加载时,"poster“图像会出现,但加载轮不会停止,视频也不会播放。
我试着在页眉和页脚中加入以下内容来启动视频,但没有成功:
<script>
window.onload = function() {
var pElement = document.getElementById("#vid");
pElement.play();
};
</script>我还在标题中包含了所有的video.js引用链接:
<!-- Link to Video JS Library -->
<script src="js/mylibs/video.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="css/video-js.css" type="text/css" media="screen" title="Video JS" charset="utf-8">
<script type="text/javascript" charset="utf-8">
// Add VideoJS to all video tags on the page when the DOM is ready
VideoJS.setupAllWhenReady();
</script>有没有人有用HTML5样板模板实现HTML5视频的好例子。无可否认,我是一个新手,所以如果这个问题看起来有点愚蠢,我向你道歉。
谢谢你的帮忙!
发布于 2011-07-23 10:44:55
您可能不应该将它们包含在和页脚中。您应该只将粘贴在开头的脚本包含在video.js引用链接集的底部。
您可以随时将代码粘贴到http://jsfiddle.net,然后再次询问,以便可以更快地修复它。
https://stackoverflow.com/questions/6779931
复制相似问题