我似乎无法获得爆米花图片插件或任何其他插件才能正常工作。而且我不确定为什么。这是file.js中的代码。
var popcorn = Popcorn( "#video1" )
popcorn.play()
popcorn.image({
start: 5,
end: 15,
src: "http://www.usm.edu/news/sites/default/files/Prism%20Concert.jpg",
target: "image"
});
以下是file.html中的代码。
<div><video id="video1">
<source src="videos/Makeurbed.mp4" height="400" width="800">
</video></div>
以下是将我的file.js链接到我的file.html的代码。它位于我的html文件的头部。
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://popcornjs.org/code/dist/popcorn-complete.min.js"></script>
<script src="js/popcorn-complete.min.js" type="text/javascript"></script>
<script src="js/file.js" type="text/javascript"></script>
</head>
我有什么遗失的东西吗?
答案 0 :(得分:0)
我认为你需要添加分号
var popcorn = Popcorn( "#video1" );
popcorn.play();
除此之外,您还需要ID为image
的div,就像您在目标中提到的那样。
像这样添加:
<div><video id="video1" height="400" width="800" controls>
<source src="videos/Makeurbed.mp4">
</video></div>
<div id="image"></div>
还记得所有浏览器都不支持mp4格式,反之,添加更多文件格式总是更好。
像这样:<div><video id="video1" height="400" width="800" controls>
<source src="videos/Makeurbed.mp4"></source>
<source src="videos/Makeurbed.ogv"></source>
<source src="videos/Makeurbed.webm"></source>
</video></div>
<div id="image"></div>
还在视频标记内添加高度和宽度,而不是在源标记内