mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 14: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,22 +1,28 @@
|
||||
export default function switchMix(art, player) {
|
||||
const { refs: { $video }, i18n, notice, isPlaying, option } = art;
|
||||
const {
|
||||
refs: { $video },
|
||||
i18n,
|
||||
notice,
|
||||
isPlaying,
|
||||
option,
|
||||
} = art;
|
||||
|
||||
Object.defineProperty(player, 'switch', {
|
||||
value: (url, name = 'unknown') => {
|
||||
if (url !== option.url) {
|
||||
const { currentTime } = player;
|
||||
art.emit('beforeMountUrl', url);
|
||||
$video.src = player.mountUrl(url);
|
||||
option.url = url;
|
||||
player.playbackRateRemove();
|
||||
player.aspectRatioRemove();
|
||||
player.seek(currentTime);
|
||||
if (isPlaying) {
|
||||
player.play();
|
||||
}
|
||||
notice.show(`${i18n.get('Switch video')}: ${name}`);
|
||||
art.emit('switch', url);
|
||||
}
|
||||
}
|
||||
});
|
||||
Object.defineProperty(player, 'switch', {
|
||||
value: (url, name = 'unknown') => {
|
||||
if (url !== option.url) {
|
||||
const { currentTime } = player;
|
||||
art.emit('beforeMountUrl', url);
|
||||
$video.src = player.mountUrl(url);
|
||||
option.url = url;
|
||||
player.playbackRateRemove();
|
||||
player.aspectRatioRemove();
|
||||
player.seek(currentTime);
|
||||
if (isPlaying) {
|
||||
player.play();
|
||||
}
|
||||
notice.show(`${i18n.get('Switch video')}: ${name}`);
|
||||
art.emit('switch', url);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user