This commit is contained in:
Harvey Zack committed 2019-04-19 08:51:16 +08:00
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();
});
},
});
+2
View File
@@ -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');
}
}
+5 -1
View File
@@ -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) {