mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 14:41:20 -08:00
update resize
This commit is contained in:
1 parent
2faffecc00
commit
39452167c3
6 files changed
+24
-41
No files matched your search
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user