mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 04:31:20 -08:00
bugfix
This commit is contained in:
1 parent
a26afec5ac
commit
59581f9e97
6 files changed
+5
-80
No files matched your search
@@ -2,7 +2,6 @@ export default class Thumbnails {
|
||||
constructor(art, option) {
|
||||
this.art = art;
|
||||
this.option = option;
|
||||
this.isLoad = false;
|
||||
this.init();
|
||||
}
|
||||
|
||||
@@ -13,10 +12,8 @@ export default class Thumbnails {
|
||||
} = this.art;
|
||||
|
||||
proxy($progress, 'mousemove', event => {
|
||||
this.checkLoad(this.art.option.thumbnails.url).then(() => {
|
||||
this.option.ref.style.display = 'block';
|
||||
this.showThumbnails(event);
|
||||
});
|
||||
this.option.ref.style.display = 'block';
|
||||
this.showThumbnails(event);
|
||||
});
|
||||
|
||||
proxy($progress, 'mouseout', () => {
|
||||
@@ -24,30 +21,6 @@ export default class Thumbnails {
|
||||
});
|
||||
}
|
||||
|
||||
checkLoad(url) {
|
||||
if (this.isLoad) {
|
||||
return Promise.resolve(url);
|
||||
}
|
||||
const { proxy } = this.art.events;
|
||||
return new Promise((resolve, reject) => {
|
||||
const $img = new Image();
|
||||
$img.src = url;
|
||||
if ($img.complete) {
|
||||
this.isLoad = true;
|
||||
resolve(url);
|
||||
}
|
||||
|
||||
proxy($img, 'load', () => {
|
||||
this.isLoad = true;
|
||||
resolve(url);
|
||||
});
|
||||
|
||||
proxy($img, 'error', () => {
|
||||
reject(url);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
showThumbnails(event) {
|
||||
const { $progress } = this.art.refs;
|
||||
const { width: posWidth } = this.getPosFromEvent(event);
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import Mse from './mse';
|
||||
|
||||
export default {
|
||||
Mse
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
export default class Mse {
|
||||
constructor(art) {
|
||||
this.art = art;
|
||||
console.log(this);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
export default class Srt {
|
||||
constructor(art) {
|
||||
this.art = art;
|
||||
console.log(this);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user