mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 10:31:20 -08:00
删除多余事件
This commit is contained in:
1 parent
e0faa3fe68
commit
7ff61b4660
38 files changed
+266
-516
No files matched your search
@@ -1,26 +1,24 @@
|
||||
import { def } from '../utils';
|
||||
|
||||
export default function switchMix(art, player) {
|
||||
const { i18n, notice, option } = art;
|
||||
const { i18n, notice } = art;
|
||||
|
||||
function switchUrl(url, name, currentTime) {
|
||||
if (url === player.url) return Promise.resolve(url);
|
||||
if (url === player.url) return;
|
||||
URL.revokeObjectURL(player.url);
|
||||
return player.attachUrl(url).then(() => {
|
||||
option.url = url;
|
||||
player.playbackRate = false;
|
||||
player.aspectRatio = false;
|
||||
art.once('video:canplay', () => {
|
||||
player.currentTime = currentTime;
|
||||
});
|
||||
if (player.playing) {
|
||||
player.play = true;
|
||||
}
|
||||
if (name) {
|
||||
notice.show = `${i18n.get('Switch video')}: ${name}`;
|
||||
}
|
||||
art.emit('switch', url);
|
||||
player.url = url;
|
||||
player.playbackRate = false;
|
||||
player.aspectRatio = false;
|
||||
art.once('video:canplay', () => {
|
||||
player.currentTime = currentTime;
|
||||
});
|
||||
if (player.playing) {
|
||||
player.play = true;
|
||||
}
|
||||
if (name) {
|
||||
notice.show = `${i18n.get('Switch video')}: ${name}`;
|
||||
}
|
||||
art.emit('switch', url);
|
||||
}
|
||||
|
||||
def(player, 'switchQuality', {
|
||||
|
||||
Reference in new issue
Block a user