我在页面加载时显示完整视频,并提供用户选择具有起点和终点的特定段的选项。我需要每当用户点击任何特定细分时,视频应该从该起点开始,并以细分截止点结束,如附带的屏幕截图所示。
http://prntscr.com/f0xfav
jwplayer版本:5.10.2295
我的代码如下:
jwplayer('viewer').setup({
flashplayer: '<?php echo base_url() ?>js/jwplayer/player.swf',
file: '<?php echo $generalInfo->resourceUrl; ?>',
height: 400,
width: 900
});
//below code work but I'm not sure if it's correct way to achieve this.
jwplayer().onPlay(function () {
setTimeout(function ()
{
jwplayer().seek(30);
}, 500);
});
jwplayer().onTime(function () {
if (jwplayer().getPosition() >= '60') {
jwplayer().play(false);
}
});