添加ready事件

This commit is contained in:
Harvey committed 2019-10-10 11:33:24 +08:00
1 parent d43a71b931
commit a6816d68fa
10 files changed
+42 -51

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ export default class Contextmenu {
constructor(art) {
this.id = 0;
this.art = art;
this.art.once('video:canplay', () => {
this.art.on('ready', () => {
this.init();
});
+1 -1
View File
@@ -17,7 +17,7 @@ export default class Controls {
constructor(art) {
this.id = 0;
this.art = art;
this.art.once('video:canplay', () => {
this.art.on('ready', () => {
this.init();
});
}
+1 -1
View File
@@ -3,7 +3,7 @@ export default class Hotkey {
this.art = art;
this.keys = {};
if (this.art.option.hotkey) {
this.art.once('video:canplay', () => {
this.art.on('ready', () => {
this.add(27, () => {
if (art.player.fullscreenWeb) {
art.player.fullscreenWeb = false;
+1 -1
View File
@@ -5,7 +5,7 @@ export default class Layers {
this.id = 0;
this.art = art;
this.add = this.add.bind(this);
this.art.once('video:canplay', () => {
this.art.on('ready', () => {
this.art.option.layers.forEach(item => {
this.add(item);
});
+11 -7
View File
@@ -9,10 +9,10 @@ export default function eventInit(art, player) {
i18n,
notice,
} = art;
let reconnectTime = 0;
const maxReconnectTime = 5;
proxy($video, 'click', () => {
player.toggle = true;
});
@@ -24,7 +24,7 @@ export default function eventInit(art, player) {
});
// art.on('video:abort', () => {
// });
art.on('video:canplay', () => {
@@ -34,6 +34,10 @@ export default function eventInit(art, player) {
art.loading.show = false;
});
art.once('video:canplay', () => {
art.emit('ready');
});
// art.on('video:canplaythrough', () => {
// });
@@ -74,7 +78,7 @@ export default function eventInit(art, player) {
});
// art.on('video:loadeddata', () => {
// });
art.on('video:loadedmetadata', () => {
@@ -117,11 +121,11 @@ export default function eventInit(art, player) {
});
// art.on('video:stalled', () => {
// });
// art.on('video:suspend', () => {
// });
art.on('video:timeupdate', () => {
@@ -129,7 +133,7 @@ export default function eventInit(art, player) {
});
// art.on('video:volumechange', () => {
// });
art.on('video:waiting', () => {
+1 -1
View File
@@ -9,7 +9,7 @@ export default class Setting {
this.art = art;
this.state = false;
if (art.option.setting) {
this.art.once('video:canplay', () => {
this.art.on('ready', () => {
this.init();
});