如何识别,视频已到达最后一张幻灯片或特定时间段.将 JW 播放器与 RTMP 视频点播一起使用



如何识别, 用户已看完RTMP视频,我需要在观看完整视频后触发功能。

我正在使用带有RTMP视频点播(Wowza VOD(流媒体的JW播放器。

JwPlayer 脚本具有内置事件,例如 .setup、.onError、.onReady、.onComplete,如下所述。

jwplayer('#videoBox').setup({
        file: videoFile,
        image: "/path/to/image/videoslogo.png",                        
        rtmp: {
            securetoken: "123456789ABCD"
        },
        width: "80%",
        aspectratio: "21:9"
 });
//onError, Show a alert box
jwplayer('#videoBox').onError ( function(event) { 
                    alert("Sorry for an inconvenience, Something went wrong, Please create a ticket, Thanks.");
});
//On Ready, play after 2000 milli seconds
jwplayer('#videoBox').onReady ( function(event) {
        setTimeout(function() {
           jwplayer('#videoBox').play(true);
        },2000);
})
// on Complete, Change Lecture status and Assign Next entities
jwplayer('#videoBox').onComplete( function(event) {
   //Trigger required function here
});

希望它可能对某人有所帮助。谢谢

最新更新