use timeupdate event
This commit is contained in:
+1
-15
@@ -1,5 +1,3 @@
|
||||
import utils from './utils';
|
||||
|
||||
class Timer {
|
||||
constructor (player) {
|
||||
this.player = player;
|
||||
@@ -15,7 +13,7 @@ class Timer {
|
||||
}
|
||||
)();
|
||||
|
||||
this.types = ['loading', 'progress', 'info', 'fps'];
|
||||
this.types = ['loading', 'info', 'fps'];
|
||||
|
||||
this.init();
|
||||
}
|
||||
@@ -54,18 +52,6 @@ class Timer {
|
||||
}, 100);
|
||||
}
|
||||
|
||||
initprogressChecker () {
|
||||
this.progressChecker = setInterval(() => {
|
||||
if (this.enableprogressChecker) {
|
||||
this.player.bar.set('played', this.player.video.currentTime / this.player.video.duration, 'width');
|
||||
const currentTime = utils.secondToTime(this.player.video.currentTime);
|
||||
if (this.player.template.ptime.innerHTML !== currentTime) {
|
||||
this.player.template.ptime.innerHTML = currentTime;
|
||||
}
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
initfpsChecker () {
|
||||
window.requestAnimationFrame(() => {
|
||||
if (this.enablefpsChecker) {
|
||||
|
||||
Reference in New Issue
Block a user