mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-27 06:31:50 +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) {
|
if (isFullscreen) {
|
||||||
isFullscreen = false;
|
isFullscreen = false;
|
||||||
emit("fullscreen", isFullscreen);
|
emit("fullscreen", isFullscreen);
|
||||||
|
emit("needstrack", false);
|
||||||
if (!fscreen.fullscreenElement) return;
|
if (!fscreen.fullscreenElement) return;
|
||||||
fscreen.exitFullscreen();
|
fscreen.exitFullscreen();
|
||||||
return;
|
return;
|
||||||
@ -192,7 +193,10 @@ export function makeVideoElementDisplayInterface(): DisplayInterface {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (canWebkitFullscreen()) {
|
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;
|
loading: boolean;
|
||||||
qualities: SourceQuality[];
|
qualities: SourceQuality[];
|
||||||
changedquality: SourceQuality | null;
|
changedquality: SourceQuality | null;
|
||||||
|
needstrack: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface DisplayInterface extends Listener<DisplayInterfaceEvents> {
|
export interface DisplayInterface extends Listener<DisplayInterfaceEvents> {
|
||||||
|
@ -75,6 +75,11 @@ export const createDisplaySlice: MakeSlice<DisplaySlice> = (set, get) => ({
|
|||||||
s.currentQuality = quality;
|
s.currentQuality = quality;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
newDisplay.on("needstrack", (needsTrack) => {
|
||||||
|
set((s) => {
|
||||||
|
s.caption.asTrack = needsTrack;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
set((s) => {
|
set((s) => {
|
||||||
s.display = newDisplay;
|
s.display = newDisplay;
|
||||||
|
Loading…
Reference in New Issue
Block a user