mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 01:21:20 -08:00
remove player object
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user