add restart event

This commit is contained in:
Harvey committed 2021-12-24 11:36:50 +08:00
1 parent 50a3809a10
commit dceb8e731b
5 files changed
+21 -1

No files matched your search

@@ -40,6 +40,7 @@ export default function eventInit(art, player) {
art.loading.show = false;
art.controls.show = true;
art.mask.show = true;
art.isReady = true;
art.emit('ready');
});
+8
View File
@@ -19,6 +19,14 @@ export default function urlMix(art, player) {
typeCallback.call(art, $video, url, art);
});
} else {
if (player.url && player.url !== url) {
art.once('video:canplay', () => {
if (art.isReady) {
art.emit('restart');
}
});
}
$video.src = url;
art.option.url = url;
art.emit('url', url);