mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 16:11:20 -08:00
fix ios subtitle
This commit is contained in:
1 parent
1e460de2e8
commit
8d057080f1
5 files changed
+16
-12
No files matched your search
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user