mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-14 00:06:17 -08:00
build all packages
This commit is contained in:
1 parent
773714f739
commit
89fecf5488
22 files changed
+60
-57
No files matched your search
@@ -10,7 +10,7 @@ export default class Contextmenu {
|
||||
constructor(art) {
|
||||
this.id = 0;
|
||||
this.art = art;
|
||||
this.art.on('firstCanplay', () => {
|
||||
this.art.once('video:canplay', () => {
|
||||
this.init();
|
||||
});
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ export default class Controls {
|
||||
constructor(art) {
|
||||
this.id = 0;
|
||||
this.art = art;
|
||||
this.art.on('firstCanplay', () => {
|
||||
this.art.once('video:canplay', () => {
|
||||
this.init();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ export default class Events {
|
||||
this.proxy = this.proxy.bind(this);
|
||||
this.hover = this.hover.bind(this);
|
||||
this.loadImg = this.loadImg.bind(this);
|
||||
art.on('firstCanplay', () => {
|
||||
art.once('video:canplay', () => {
|
||||
clickInit(art, this);
|
||||
hoverInit(art, this);
|
||||
mousemoveInit(art, this);
|
||||
|
||||
@@ -30,7 +30,7 @@ export default class Hotkey {
|
||||
});
|
||||
|
||||
if (this.art.option.hotkey) {
|
||||
this.art.on('firstCanplay', () => {
|
||||
this.art.once('video:canplay', () => {
|
||||
this.init();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ export default class Layers {
|
||||
this.id = 0;
|
||||
this.art = art;
|
||||
this.add = this.add.bind(this);
|
||||
this.art.on('firstCanplay', () => {
|
||||
this.art.once('video:canplay', () => {
|
||||
this.art.option.layers.forEach(item => {
|
||||
this.add(item);
|
||||
});
|
||||
|
||||
@@ -10,7 +10,6 @@ export default function eventInit(art, player) {
|
||||
notice,
|
||||
} = art;
|
||||
|
||||
let firstCanplay = false;
|
||||
let reconnectTime = 0;
|
||||
const maxReconnectTime = 5;
|
||||
|
||||
@@ -29,14 +28,6 @@ export default function eventInit(art, player) {
|
||||
// });
|
||||
|
||||
art.on('video:canplay', () => {
|
||||
if (!firstCanplay) {
|
||||
firstCanplay = true;
|
||||
if (option.autoplay) {
|
||||
player.play();
|
||||
}
|
||||
art.emit('firstCanplay');
|
||||
}
|
||||
|
||||
reconnectTime = 0;
|
||||
art.controls.show();
|
||||
art.mask.show();
|
||||
|
||||
@@ -9,7 +9,7 @@ export default class Setting {
|
||||
this.art = art;
|
||||
this.state = false;
|
||||
if (art.option.setting) {
|
||||
this.art.on('firstCanplay', () => {
|
||||
this.art.once('video:canplay', () => {
|
||||
this.init();
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user