添加监听视频卡顿的插件

This commit is contained in:
Harvey committed 2019-09-11 10:14:47 +08:00
1 parent cef60c4d9a
commit 05cbe4dad6
10 files changed
+149 -1

No files matched your search

+28
View File
@@ -617,6 +617,34 @@ var art = new Artplayer({
});
```
## networkMonitor
- Type: `Boolean`
- Default: `false`
A network monitor is used to monitor the blocking of the video.
[Run Code](/)
```js
var url = 'https://zhw2590582.github.io/assets-cdn';
var art = new Artplayer({
container: '.artplayer-app',
url: url + '/video/one-more-time-one-more-chance-480p.mp4',
networkMonitor: true,
});
// Is the ratio of the time the video is blocked to the time the video has been played.
// For example, when the ratio is equal to 0.3, it means that every ten seconds, it is blocked for three seconds.
let notice = false;
art.on('networkMonitor', ratio => {
if (ratio >= 0.5 && !notice) {
notice = true;
console.log('Current network condition is not good');
}
});
```
## subtitle
- Type: `Object`