H5页面播放视频—试看3分钟(使用video.js)

var myPlayer = videojs('#small-video');
    videojs('#small-video', {}, function() {
      $('#small-video source').attr('src', reloadUrl);
      myPlayer.src(reloadUrl);
      myPlayer.load(reloadUrl);
      if (autoPlay === true) {
        myPlayer.play();
         if (autoPlay === true) {
        myPlayer.play();
        myPlayer.on('timeupdate', function () {  
	            console.log(myPlayer.currentTime());
        });
      }
    
    myPlayer.on('play', function () {
           console.log('开始/恢复播放');
       });
      }
    });

 

你可能感兴趣的:(播放视频)