mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 12:41: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
@@ -240,7 +240,7 @@ class Artplayer extends (0, _emitterDefault.default) {
|
||||
return "development";
|
||||
}
|
||||
static get build() {
|
||||
return "1655888143078";
|
||||
return "1655889433954";
|
||||
}
|
||||
static get config() {
|
||||
return 0, _configDefault.default;
|
||||
@@ -1499,19 +1499,15 @@ var _utils = require("../utils");
|
||||
function playMix(art) {
|
||||
const { i18n , notice , option , constructor: { instances } , template: { $video } , } = art;
|
||||
(0, _utils.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++){
|
||||
const instance = instances[index];
|
||||
if (instance !== art) instance.pause();
|
||||
}
|
||||
notice.show = i18n.get("Play");
|
||||
art.emit("play");
|
||||
return promise;
|
||||
return result;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user