mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 06:31: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;
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user