1
我认为这是一个非常基本的/愚蠢的问题,但我不明白我在做什么错误...我想添加字幕和时间轴到HTML5视频使用popcorn.js。不能让popcorn.js工作
这里的HTML5代码:
<script src="http://popcornjs.org/code/dist/popcorn-complete.js">
</script>
(...)
<nav id="timeline"> </nav>
(...)
<video id="video" controls>
<source src="media/ita.webm" type="video/webm">
<source src="media/ita.mp4" type="video/mp4">
</video>
(...)
这里的爆米花部分:
document.addEventListener("DOMContentLoaded", function() {
var popcorn = Popcorn('#video', { pauseOnLinkClicked: true });
popcorn.timeline({
start: 1,
target: "timeline",
title: "This is a title",
text: "this is some interesting text that goes inside",
innerHTML: "Click here for <a href='http://www.google.ca'>Google</a>" ,
direction: "down"
})
.timeline({
start: 3,
target: "#timeline",
title: "double as interesting",
text: "this is some interesting text that goes inside",
innerHTML: "Maybe a button? <button onClick=\"window.location.href='http://www.google.com'\">Click Me</button>",
direction: "down"
})
.timeline({
start: 7,
end: 10,
target: "#timeline",
title: "3x as interesting",
text: "this is some interesting text that goes inside",
innerHTML: "",
direction: "down"
});
popcorn.subtitle({
start: 1,
end: 5,
text: "Subtitle",
});
popcorn.play();
}, false);
的pauseOnLinkClicked: true
是的工作只有一部分...
感谢您的回答。 对不起,我忘了改变目标,但无论如何,我还没有看到字幕和时间轴。 – Jan
@Jan做我的例子不工作? –
对不起。 您的示例工程,现在在我的代码中,我看到了时间轴(具有奇怪的布局),但我仍然没有subs,我会尝试再处理它。 – Jan