update urlMix

This commit is contained in:
Harvey committed 2022-06-27 10:37:13 +08:00
1 parent 19d9e5cea9
commit bff84f9cb6
4 files changed
+42 -29

No files matched your search

+17 -12
View File
@@ -240,7 +240,7 @@ class Artplayer extends (0, _emitterDefault.default) {
return "development";
}
static get build() {
return "1656294635259";
return "1656296990952";
}
static get config() {
return 0, _configDefault.default;
@@ -1458,19 +1458,24 @@ function urlMix(art) {
return $video.currentSrc;
},
async set (url) {
const typeName = option.type || (0, _utils.getExt)(url);
const typeCallback = option.customType[typeName];
if (typeName && typeCallback) {
if (url) {
const typeName = option.type || (0, _utils.getExt)(url);
const typeCallback = option.customType[typeName];
if (typeName && typeCallback) {
await (0, _utils.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 (0, _utils.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);
}
}
});