mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 22:01:20 -08:00
update playMix.js
This commit is contained in:
1 parent
c09713d50f
commit
1d5ff8adf0
5 files changed
+14
-26
No files matched your search
@@ -10,15 +10,10 @@ export default function playMix(art) {
|
||||
} = art;
|
||||
|
||||
def(art, 'play', {
|
||||
value() {
|
||||
const promise = $video.play();
|
||||
|
||||
if (promise && promise.then) {
|
||||
promise.then().catch((err) => {
|
||||
notice.show = err;
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
value: async function () {
|
||||
const result = await $video.play();
|
||||
notice.show = i18n.get('Play');
|
||||
art.emit('play');
|
||||
|
||||
if (option.mutex) {
|
||||
for (let index = 0; index < instances.length; index++) {
|
||||
@@ -29,10 +24,7 @@ export default function playMix(art) {
|
||||
}
|
||||
}
|
||||
|
||||
notice.show = i18n.get('Play');
|
||||
art.emit('play');
|
||||
|
||||
return promise;
|
||||
return result;
|
||||
},
|
||||
});
|
||||
}
|
||||
+1
-1
@@ -552,7 +552,7 @@ declare class Player {
|
||||
get subtitleOffset(): number;
|
||||
set subtitleOffset(time: number);
|
||||
pause(): any;
|
||||
play(): any;
|
||||
play(): Promise<unknown>;
|
||||
toggle(): any;
|
||||
attr(key: string, value: any): void;
|
||||
switchUrl(url: string): Promise<string>;
|
||||
|
||||
Reference in new issue
Block a user