mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-28 13:28:48 +00:00
some change
This commit is contained in:
parent
400a4313d9
commit
8996301e83
3 changed files with 19 additions and 1 deletions
|
|
@ -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 */}
|
||||
|
|
|
|||
|
|
@ -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 */}
|
||||
|
|
|
|||
|
|
@ -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<CustomSubtitlesProps> = ({
|
|||
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<CustomSubtitlesProps> = ({
|
|||
|
||||
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<CustomSubtitlesProps> = ({
|
|||
<View
|
||||
style={[
|
||||
styles.customSubtitleContainer,
|
||||
{ bottom: bottomOffset },
|
||||
{ bottom: effectiveBottom },
|
||||
]}
|
||||
pointerEvents="none"
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in a new issue