此代码在结束时触发,显示bigPlayButton但不显示posterImage ???任何人都知道正确的方法。使用videojs 4.3.0
videojs( “example_video_1”)。就绪(函数(){
var vid = this;
vid.on("ended", function(){
alert ("I have triggered");
vid.posterImage.show();
vid.bigPlayButton.show();
vid.currentTime(0);
});
});
答案 0 :(得分:1)
这是我的解决方案:
var currvideo = $('.vjs-playing').attr('id')
if (currvideo){
var vid = videojs(currvideo);
vid.pause();
vid.posterImage.show();
vid.currentTime(0);
vid.controlBar.hide();
vid.bigPlayButton.show();
vid.cancelFullScreen();
}