mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 16:11:20 -08:00
update ts
This commit is contained in:
1 parent
7dfe78a95d
commit
69563e818b
10 files changed
+353
-120
No files matched your search
@@ -4,25 +4,28 @@ export default function switchMix(art, player) {
|
||||
const { i18n, option, notice } = art;
|
||||
|
||||
function switchUrl(url, name, currentTime) {
|
||||
if (url === player.url) return;
|
||||
URL.revokeObjectURL(player.url);
|
||||
const { playing } = player;
|
||||
player.url = url;
|
||||
art.once('video:canplay', () => {
|
||||
player.playbackRate = false;
|
||||
player.aspectRatio = false;
|
||||
player.flip = 'normal';
|
||||
player.autoSize = option.autoSize;
|
||||
player.currentTime = currentTime;
|
||||
art.notice.show = '';
|
||||
if (playing) {
|
||||
player.play();
|
||||
}
|
||||
if (name) {
|
||||
notice.show = `${i18n.get('Switch video')}: ${name}`;
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
if (url === player.url) return resolve(url);
|
||||
URL.revokeObjectURL(player.url);
|
||||
const { playing } = player;
|
||||
player.url = url;
|
||||
art.once('video:canplay', () => {
|
||||
player.playbackRate = false;
|
||||
player.aspectRatio = false;
|
||||
player.flip = 'normal';
|
||||
player.autoSize = option.autoSize;
|
||||
player.currentTime = currentTime;
|
||||
art.notice.show = '';
|
||||
if (playing) {
|
||||
player.play();
|
||||
}
|
||||
if (name) {
|
||||
notice.show = `${i18n.get('Switch video')}: ${name}`;
|
||||
}
|
||||
art.emit('switch', url);
|
||||
resolve(url);
|
||||
});
|
||||
});
|
||||
art.emit('switch', url);
|
||||
}
|
||||
|
||||
def(player, 'switchQuality', {
|
||||
|
||||
Reference in new issue
Block a user