fix ios subtitle

This commit is contained in:
Harvey committed 2022-09-07 16:45:05 +08:00
1 parent 1e460de2e8
commit 8d057080f1
5 files changed
+16 -12

No files matched your search

+7 -4
View File
@@ -3728,11 +3728,14 @@ class Subtitle extends (0, _componentDefault.default) {
this.name = "subtitle";
this.eventDestroy = ()=>null;
this.init(art.option.subtitle);
art.on("fullscreen", (state)=>{
let lastState = false;
art.on("video:timeupdate", ()=>{
if (!this.url) return;
const { $video } = this.art.template;
if (state && $video.webkitDisplayingFullscreen) this.createTrack("subtitles", this.url);
else this.createTrack("metadata", this.url);
const state = this.art.template.$video.webkitDisplayingFullscreen;
if (state !== lastState) {
lastState = state;
this.createTrack(state ? "subtitles" : "metadata", this.url);
}
});
}
get url() {