mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-22 05:11:20 -08:00
update urlMix
This commit is contained in:
1 parent
19d9e5cea9
commit
bff84f9cb6
4 files changed
+42
-29
No files matched your search
@@ -11,24 +11,29 @@ export default function urlMix(art) {
|
||||
return $video.currentSrc;
|
||||
},
|
||||
async set(url) {
|
||||
const typeName = option.type || getExt(url);
|
||||
const typeCallback = option.customType[typeName];
|
||||
if (typeName && typeCallback) {
|
||||
if (url) {
|
||||
const typeName = option.type || getExt(url);
|
||||
const typeCallback = option.customType[typeName];
|
||||
if (typeName && typeCallback) {
|
||||
await sleep();
|
||||
art.loading.show = true;
|
||||
typeCallback.call(art, $video, url, art);
|
||||
} else {
|
||||
if (art.url && art.url !== url) {
|
||||
art.once('video:canplay', () => {
|
||||
if (art.isReady) {
|
||||
art.emit('restart');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$video.src = url;
|
||||
art.option.url = url;
|
||||
art.emit('url', url);
|
||||
}
|
||||
} else {
|
||||
await sleep();
|
||||
art.loading.show = true;
|
||||
typeCallback.call(art, $video, url, art);
|
||||
} else {
|
||||
if (art.url && art.url !== url) {
|
||||
art.once('video:canplay', () => {
|
||||
if (art.isReady) {
|
||||
art.emit('restart');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$video.src = url;
|
||||
art.option.url = url;
|
||||
art.emit('url', url);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user