2 回答

TA貢獻(xiàn)1906條經(jīng)驗(yàn) 獲得超3個(gè)贊
我希望其中之一有幫助
var options = {};
var player = videojs('my-video', options, function onPlayerReady() {
this.on('ended', function() {
//do something here...
});
});
或者
var player = document.getElementById("my-video");
player.addEventListener("ended", function() {
//do something here...
});

TA貢獻(xiàn)1790條經(jīng)驗(yàn) 獲得超9個(gè)贊
由于 Jsplayer 無法正常工作,我使用了 html5 視頻播放器,它很好:-
<video oncontextmenu="return false;" width="100%" height="auto" controls id="player"
controls controlsList="nodownload" poster="{{asset('images/'.$course->id.'.png')}}"
onended="alert('it is worked')">
<source src="{{asset('promos/'.$course->id.'.mp4')}}" type="video/mp4">
<source src="{{asset('promos/'.$course->id.'.m4v')}}" type="video/ogg">
</video>
添加回答
舉報(bào)