diff --git a/src/components/player/AndroidVideoPlayer.tsx b/src/components/player/AndroidVideoPlayer.tsx index cfd608f3..f8e9b7d9 100644 --- a/src/components/player/AndroidVideoPlayer.tsx +++ b/src/components/player/AndroidVideoPlayer.tsx @@ -2460,6 +2460,8 @@ const AndroidVideoPlayer: React.FC = () => { bottomOffset={subtitleBottomOffset} letterSpacing={subtitleLetterSpacing} lineHeightMultiplier={subtitleLineHeightMultiplier} + controlsVisible={showControls} + controlsFixedOffset={Math.min(Dimensions.get('window').width, Dimensions.get('window').height) >= 768 ? 120 : 100} /> {/* Resume overlay removed when AlwaysResume is enabled; overlay component omitted */} diff --git a/src/components/player/VideoPlayer.tsx b/src/components/player/VideoPlayer.tsx index da4bb6aa..11750f46 100644 --- a/src/components/player/VideoPlayer.tsx +++ b/src/components/player/VideoPlayer.tsx @@ -2291,6 +2291,8 @@ const VideoPlayer: React.FC = () => { bottomOffset={subtitleBottomOffset} letterSpacing={subtitleLetterSpacing} lineHeightMultiplier={subtitleLineHeightMultiplier} + controlsVisible={showControls} + controlsFixedOffset={Math.min(Dimensions.get('window').width, Dimensions.get('window').height) >= 768 ? 126 : 106} /> {/* Resume overlay removed when AlwaysResume is enabled; overlay component omitted */} diff --git a/src/components/player/subtitles/CustomSubtitles.tsx b/src/components/player/subtitles/CustomSubtitles.tsx index 015ec65d..bc9d2dc5 100644 --- a/src/components/player/subtitles/CustomSubtitles.tsx +++ b/src/components/player/subtitles/CustomSubtitles.tsx @@ -19,6 +19,10 @@ interface CustomSubtitlesProps { outlineWidth?: number; // px align?: 'center' | 'left' | 'right'; bottomOffset?: number; // px from bottom + // Controls overlay awareness + controlsVisible?: boolean; + controlsExtraOffset?: number; // additional px to push up when controls are visible + controlsFixedOffset?: number; // fixed px when controls visible (ignores user offset) letterSpacing?: number; lineHeightMultiplier?: number; // multiplies subtitleSize } @@ -38,6 +42,9 @@ export const CustomSubtitles: React.FC = ({ outlineWidth = 2, align = 'center', bottomOffset = 20, + controlsVisible = false, + controlsExtraOffset = 0, + controlsFixedOffset, letterSpacing = 0, lineHeightMultiplier = 1.2, }) => { @@ -45,6 +52,13 @@ export const CustomSubtitles: React.FC = ({ const inverseScale = 1 / zoomScale; const bgColor = subtitleBackground ? `rgba(0, 0, 0, ${Math.min(Math.max(backgroundOpacity, 0), 1)})` : 'transparent'; + let effectiveBottom = bottomOffset; + if (controlsVisible) { + effectiveBottom = controlsFixedOffset !== undefined + ? controlsFixedOffset + : bottomOffset + controlsExtraOffset; + } + effectiveBottom = Math.max(0, effectiveBottom); // When using crisp outline, prefer SVG text with real stroke instead of blur shadow const useCrispSvgOutline = outline === true; @@ -67,7 +81,7 @@ export const CustomSubtitles: React.FC = ({