mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 16:11:20 -08:00
修改包管理
This commit is contained in:
1 parent
c5c673ae79
commit
0aa018db6d
99 files changed
+70
-70
No files matched your search
@@ -0,0 +1,24 @@
|
||||
export default function playMix(art, player) {
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
if (mutex) {
|
||||
art.constructor.instances
|
||||
.filter(item => item !== art)
|
||||
.forEach(item => item.player.pause());
|
||||
}
|
||||
|
||||
notice.show(i18n.get('Play'));
|
||||
art.emit('play', $video);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user