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

+1 -1
View File
@@ -1,7 +1,7 @@
{
"license": "MIT",
"name": "artplayer",
"version": "4.5.4",
"version": "4.5.5",
"main": "dist/artplayer.js",
"types": "types/artplayer.d.ts",
"homepage": "https://artplayer.org",
+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);
}
});
}