remove player object

This commit is contained in:
zhw2590582 committed 2022-01-07 17:38:10 +08:00
1 parent 59a8ccce81
commit 59400eb3bf
58 files changed
+295 -313

No files matched your search

@@ -1,6 +1,6 @@
import { secondToTime, download, def } from '../utils';
export default function screenshotMix(art, player) {
export default function screenshotMix(art) {
const {
option,
notice,
@@ -9,7 +9,7 @@ export default function screenshotMix(art, player) {
const $canvas = document.createElement('canvas');
def(player, 'getDataURL', {
def(art, 'getDataURL', {
value: () =>
new Promise((resolve, reject) => {
try {
@@ -24,7 +24,7 @@ export default function screenshotMix(art, player) {
}),
});
def(player, 'getBlobUrl', {
def(art, 'getBlobUrl', {
value: () =>
new Promise((resolve, reject) => {
try {
@@ -41,9 +41,9 @@ export default function screenshotMix(art, player) {
}),
});
def(player, 'screenshot', {
def(art, 'screenshot', {
value: () => {
return player.getDataURL().then((dataUri) => {
return art.getDataURL().then((dataUri) => {
download(dataUri, `${option.title || 'artplayer'}_${secondToTime($video.currentTime)}.png`);
art.emit('screenshot', dataUri);
return dataUri;