Browse Source

show subtitles in ios fullscreen

pull/497/head
mrjvs 2 years ago
parent
commit
0ca585f70a
  1. 6
      src/components/player/display/base.ts
  2. 1
      src/components/player/display/displayInterface.ts
  3. 5
      src/stores/player/slices/display.ts

6
src/components/player/display/base.ts

@ -178,6 +178,7 @@ export function makeVideoElementDisplayInterface(): DisplayInterface { @@ -178,6 +178,7 @@ export function makeVideoElementDisplayInterface(): DisplayInterface {
if (isFullscreen) {
isFullscreen = false;
emit("fullscreen", isFullscreen);
emit("needstrack", false);
if (!fscreen.fullscreenElement) return;
fscreen.exitFullscreen();
return;
@ -192,7 +193,10 @@ export function makeVideoElementDisplayInterface(): DisplayInterface { @@ -192,7 +193,10 @@ export function makeVideoElementDisplayInterface(): DisplayInterface {
return;
}
if (canWebkitFullscreen()) {
if (videoElement) (videoElement as any).webkitEnterFullscreen();
if (videoElement) {
emit("needstrack", true);
(videoElement as any).webkitEnterFullscreen();
}
}
},
};

1
src/components/player/display/displayInterface.ts

@ -12,6 +12,7 @@ export type DisplayInterfaceEvents = { @@ -12,6 +12,7 @@ export type DisplayInterfaceEvents = {
loading: boolean;
qualities: SourceQuality[];
changedquality: SourceQuality | null;
needstrack: boolean;
};
export interface DisplayInterface extends Listener<DisplayInterfaceEvents> {

5
src/stores/player/slices/display.ts

@ -75,6 +75,11 @@ export const createDisplaySlice: MakeSlice<DisplaySlice> = (set, get) => ({ @@ -75,6 +75,11 @@ export const createDisplaySlice: MakeSlice<DisplaySlice> = (set, get) => ({
s.currentQuality = quality;
});
});
newDisplay.on("needstrack", (needsTrack) => {
set((s) => {
s.caption.asTrack = needsTrack;
});
});
set((s) => {
s.display = newDisplay;

Loading…
Cancel
Save