Javascript 爆米花图像插件不工作
我只是无法得到爆米花图像插件或任何其他插件的工作。我不知道为什么。下面是file.js中的代码Javascript 爆米花图像插件不工作,javascript,html,syntax,popcornjs,Javascript,Html,Syntax,Popcornjs,我只是无法得到爆米花图像插件或任何其他插件的工作。我不知道为什么。下面是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", targe
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>
下面是将my file.js链接到my 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>
有什么我遗漏的吗 我想你需要加上分号
var popcorn = Popcorn( "#video1" );
popcorn.play();
除此之外,您还需要id图像的div,正如您在target中提到的那样
添加如下内容:
<div><video id="video1" height="400" width="800" controls>
<source src="videos/Makeurbed.mp4">
</video></div>
<div id="image"></div>
还要记住,并非所有浏览器和viceversa都支持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>
还要在视频标记内添加高度和宽度,而不是在源标记内添加高度和宽度是否有任何错误?