mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 09:41:20 -08:00
格式化
This commit is contained in:
1 parent
0454f785be
commit
203ad0d3a0
75 files changed
+3120
-2904
No files matched your search
@@ -1,24 +1,27 @@
|
||||
export default function playMix(art, player) {
|
||||
const { refs: { $video }, i18n, notice, option: { mutex } } = art;
|
||||
const {
|
||||
refs: { $video },
|
||||
i18n,
|
||||
notice,
|
||||
option: { mutex },
|
||||
} = art;
|
||||
|
||||
Object.defineProperty(player, 'play', {
|
||||
value: () => {
|
||||
const promise = $video.play();
|
||||
if (promise !== undefined) {
|
||||
promise.then().catch(err => {
|
||||
notice.show(err, true, 3000);
|
||||
console.warn(err);
|
||||
});
|
||||
}
|
||||
Object.defineProperty(player, 'play', {
|
||||
value: () => {
|
||||
const promise = $video.play();
|
||||
if (promise !== undefined) {
|
||||
promise.then().catch(err => {
|
||||
notice.show(err, true, 3000);
|
||||
console.warn(err);
|
||||
});
|
||||
}
|
||||
|
||||
if (mutex) {
|
||||
art.constructor.instances
|
||||
.filter(item => item !== art)
|
||||
.forEach(item => item.player.pause());
|
||||
}
|
||||
if (mutex) {
|
||||
art.constructor.instances.filter(item => item !== art).forEach(item => item.player.pause());
|
||||
}
|
||||
|
||||
notice.show(i18n.get('Play'));
|
||||
art.emit('play');
|
||||
}
|
||||
});
|
||||
notice.show(i18n.get('Play'));
|
||||
art.emit('play');
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user