use async/await

This commit is contained in:
Harvey committed 2022-04-29 18:04:50 +08:00
1 parent facf8876b5
commit e34d09a99c
9 files changed
+86 -102

No files matched your search

+4 -5
View File
@@ -10,14 +10,13 @@ export default function urlMix(art) {
get() {
return $video.currentSrc;
},
set(url) {
async set(url) {
const typeName = option.type || getExt(url);
const typeCallback = option.customType[typeName];
if (typeName && typeCallback) {
sleep().then(() => {
art.loading.show = true;
typeCallback.call(art, $video, url, art);
});
await sleep();
art.loading.show = true;
typeCallback.call(art, $video, url, art);
} else {
if (art.url && art.url !== url) {
art.once('video:canplay', () => {