update playMix.js

This commit is contained in:
Harvey committed 2022-06-22 17:22:15 +08:00
1 parent c09713d50f
commit 1d5ff8adf0
5 files changed
+14 -26

No files matched your search

+5 -13
View File
@@ -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
View File
@@ -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>;