mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 05:41:20 -08:00
31 lines
740 B
JavaScript
31 lines
740 B
JavaScript
import { def } from '../utils';
|
|
|
|
export default function playMix(art) {
|
|
const {
|
|
i18n,
|
|
notice,
|
|
option,
|
|
constructor: { instances },
|
|
template: { $video },
|
|
} = art;
|
|
|
|
def(art, 'play', {
|
|
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();
|
|
}
|
|
}
|
|
}
|
|
|
|
return result;
|
|
},
|
|
});
|
|
}
|