我正在使用流程图,我通过这种方式设置视频,我为fastFwd和倒带添加了2个按钮
<div class="flowplayer" data-swf="flow/flowplayer.swf">
<video id="myvideo" class="myvideo">
<source type="video/mp4" src=""/>
</video>
</div>
<div> <a id="fastFwd" onClick="seek();return false;">fastFwd</a>
<a id="rewind" onClick="seek();return false;">rewind</a>
</div>
<script>
$("#forward, #rewind").click(function (seek) {
if (api.ready) {
var target = $(this).attr("myvideo") == "forward" ? 5 : -5;
api.seek(api.video.time + target);
}
});
</script>
But the buttons doesn't work
答案 0 :(得分:0)
您的ID似乎不正确。您需要更改HTML以在jquery中使用相同的ID,或者更改jquery中的ID以在HTML中使用相同的ID。
<script>
$("#fastFwd, #rewind").click(function (seek) {
if (api.ready) {
var target = $(this).attr("myvideo") == "forward" ? 5 : -5;
api.seek(api.video.time + target);
}
});
</script>