Js视频播放器插件Video.js使用方法详解(2)

$(".video_link").click(function() { var myPlayer = videojs('my-video'); var videoUrl = $(this).attr("videohref"); videojs("my-video", {}, function() { window.myPlayer = this; $("#mymoda .video-con #my-video source").attr("src", videoUrl); myPlayer.src(videoUrl); myPlayer.load(videoUrl); myPlayer.play(); }); $(".click-modal").click(); }); // 模态窗消失时,关闭视频 $('#mymoda').on('hidden.bs.modal', function() { myPlayer.pause();

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/9112a8f9b811d385fad899f9886a7317.html