mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 12:11:20 -08:00
优化ready事件
This commit is contained in:
1 parent
7b3913e318
commit
4cbefa172d
11 files changed
+21
-37
No files matched your search
@@ -10,7 +10,6 @@ export default function eventInit(art, player) {
|
||||
notice,
|
||||
} = art;
|
||||
|
||||
let isReady = false;
|
||||
let reconnectTime = 0;
|
||||
const maxReconnectTime = 5;
|
||||
|
||||
@@ -37,10 +36,7 @@ export default function eventInit(art, player) {
|
||||
art.loading.show = false;
|
||||
art.controls.show = true;
|
||||
art.mask.show = true;
|
||||
if (!isReady) {
|
||||
art.emit('ready');
|
||||
isReady = true;
|
||||
}
|
||||
art.emit('ready');
|
||||
});
|
||||
|
||||
// art.on('video:canplaythrough', () => {
|
||||
@@ -97,10 +93,7 @@ export default function eventInit(art, player) {
|
||||
art.loading.show = false;
|
||||
art.controls.show = true;
|
||||
art.mask.show = true;
|
||||
if (!isReady) {
|
||||
art.emit('ready');
|
||||
isReady = true;
|
||||
}
|
||||
art.emit('ready');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user