mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-11 00:05:09 +01:00
show subtitles in ios fullscreen
This commit is contained in:
parent
596e97e1ba
commit
0ca585f70a
@ -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 {
|
||||
return;
|
||||
}
|
||||
if (canWebkitFullscreen()) {
|
||||
if (videoElement) (videoElement as any).webkitEnterFullscreen();
|
||||
if (videoElement) {
|
||||
emit("needstrack", true);
|
||||
(videoElement as any).webkitEnterFullscreen();
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -12,6 +12,7 @@ export type DisplayInterfaceEvents = {
|
||||
loading: boolean;
|
||||
qualities: SourceQuality[];
|
||||
changedquality: SourceQuality | null;
|
||||
needstrack: boolean;
|
||||
};
|
||||
|
||||
export interface DisplayInterface extends Listener<DisplayInterfaceEvents> {
|
||||
|
@ -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…
Reference in New Issue
Block a user