js如何判断video播放的视频内容是已经缓存了的还是新请求的?

js如何判断video播放的视频内容是已经缓存了的还是新请求的?
比如clppr.js里面也没有相关的状态判断。

// You can either listen some events this way

var player = new Clappr.Player({

  events: {

    onReady: function() { ... }, //Fired when the player is ready on startup

    onResize: function() { ... },//Fired when player resizes

    onPlay: function() { ... },//Fired when player starts to play

    onPause: function() { ... },//Fired when player pauses

    onStop: function() { ... },//Fired when player stops

    onEnded: function() { ... },//Fired when player ends the video

    onSeek: function() { ... },//Fired when player seeks the video

    onError: function() { ... },//Fired when player receives an error

    onTimeUpdate: function() { ... },//Fired when the time is updated on player

    onVolumeUpdate: function() { ... },//Fired when player updates its volume

  }

})

// or this way

player.on(Clappr.Events.PLAYER_PLAY, function() { ... })


芜湖不芜
浏览 3641回答 1
1回答

慕斯709654

你想新请求就加个时间戳。读缓存会特别快。加载慢一点。如果错误的话,会有error。这样来看的话。设置一个超时间,超过这个时间不报错的就是错误。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript