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

+6 -6
View File
@@ -21,13 +21,13 @@ export default class Subtitle extends Component {
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);
}
});
}