2 回答
TA贡献1906条经验 获得超3个赞
我希望其中之一有帮助
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贡献1790条经验 获得超9个赞
由于 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>
添加回答
举报