update resize

This commit is contained in:
Harvey Zack committed 2023-05-13 21:39:45 +08:00
1 parent 2faffecc00
commit 39452167c3
6 files changed
+24 -41

No files matched your search

@@ -22,14 +22,11 @@ export default function fullscreenMix(art) {
art.state = 'fullscreen';
await screenfull.request($player);
addClass($player, 'art-fullscreen');
art.emit('resize');
notice.show = '';
} else {
await screenfull.exit();
removeClass($player, 'art-fullscreen');
art.emit('resize');
notice.show = '';
}
art.emit('resize');
},
});
};
@@ -44,12 +41,11 @@ export default function fullscreenMix(art) {
art.state = 'fullscreen';
$video.webkitEnterFullscreen();
art.emit('fullscreen', true);
notice.show = '';
} else {
$video.webkitExitFullscreen();
art.emit('fullscreen', false);
notice.show = '';
}
art.emit('resize');
},
});
};
@@ -2,7 +2,6 @@ import { addClass, removeClass, hasClass, def, append } from '../utils';
export default function fullscreenWebMix(art) {
const {
notice,
constructor,
template: { $container, $player },
} = art;
@@ -20,9 +19,7 @@ export default function fullscreenWebMix(art) {
}
art.state = 'fullscreenWeb';
addClass($player, 'art-fullscreen-web');
art.emit('resize');
art.emit('fullscreenWeb', true);
notice.show = '';
} else {
if (constructor.FULLSCREEN_WEB_IN_BODY) {
append($container, $player);
@@ -32,10 +29,10 @@ export default function fullscreenWebMix(art) {
cssText = '';
}
removeClass($player, 'art-fullscreen-web');
art.emit('resize');
art.emit('fullscreenWeb', false);
notice.show = '';
}
art.emit('resize');
},
});
}
+7 -8
View File
@@ -4,25 +4,24 @@ export default function switchMix(art) {
function switchUrl(url, currentTime) {
return new Promise((resolve, reject) => {
if (url === art.url) return;
const { playing, aspectRatio, playbackRate, option } = art;
const { playing, aspectRatio, playbackRate } = art;
art.pause();
art.url = url;
art.notice.show = '';
art.once('video:error', reject);
art.once('video:canplay', () => {
art.once('video:canplay', async () => {
art.playbackRate = playbackRate;
art.aspectRatio = aspectRatio;
art.currentTime = currentTime;
art.notice.show = '';
if (option.autoSize) {
art.autoSize = true;
}
if (playing) {
art.play();
await art.play();
}
art.notice.show = '';
resolve();
});
});
@@ -29,7 +29,6 @@ export default function autoOrientation(art) {
if (hasClass($player, 'art-auto-orientation')) {
removeClass($player, 'art-auto-orientation');
art.isRotate = false;
art.notice.show = '';
art.emit('resize');
}
}