mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 02:01:20 -08:00
Merge branch 'master' of https://github.com/zhw2590582/ArtPlayer
This commit is contained in:
commit
48436c008d
19 files changed
+150
-116
No files matched your search
@@ -14,7 +14,7 @@ export default function screenshot(controlOption) {
|
||||
const $screenshot = append($control, icons.screenshot);
|
||||
tooltip($screenshot, i18n.get('Screenshot'));
|
||||
proxy($screenshot, 'click', () => {
|
||||
player.downloadScreenshot();
|
||||
player.screenshot();
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -110,6 +110,7 @@ class Artplayer extends Emitter {
|
||||
this.template = new Template(this);
|
||||
if (this.whitelist.state) {
|
||||
this.isFocus = false;
|
||||
this.isDestroy = false;
|
||||
this.storage = new Storage(this);
|
||||
this.i18n = new I18n(this);
|
||||
this.notice = new Notice(this);
|
||||
@@ -140,6 +141,7 @@ class Artplayer extends Emitter {
|
||||
}
|
||||
this.template.destroy(removeHtml);
|
||||
Artplayer.instances.splice(Artplayer.instances.indexOf(this), 1);
|
||||
this.isDestroy = true;
|
||||
this.emit('destroy');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,11 @@ export default class Info {
|
||||
const types = Array.from($infoPanel.querySelectorAll('[data-video]'));
|
||||
types.forEach(item => {
|
||||
const value = $video[item.dataset.video];
|
||||
item.innerHTML = value !== undefined ? value : 'unknown';
|
||||
if (value !== undefined) {
|
||||
item.innerHTML = typeof value === 'number' ? value.toFixed(2) : value;
|
||||
} else {
|
||||
item.innerHTML = 'unknown';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export default function screenshotMix(art, player) {
|
||||
},
|
||||
});
|
||||
|
||||
Object.defineProperty(player, 'downloadScreenshot', {
|
||||
Object.defineProperty(player, 'screenshot', {
|
||||
value: () => {
|
||||
const dataUri = player.getScreenshotDataURL();
|
||||
if (dataUri) {
|
||||
|
||||
Reference in new issue
Block a user