mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-21 00:32:04 +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}
|
bottomOffset={subtitleBottomOffset}
|
||||||
letterSpacing={subtitleLetterSpacing}
|
letterSpacing={subtitleLetterSpacing}
|
||||||
lineHeightMultiplier={subtitleLineHeightMultiplier}
|
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 */}
|
{/* Resume overlay removed when AlwaysResume is enabled; overlay component omitted */}
|
||||||
|
|
|
||||||
|
|
@ -2291,6 +2291,8 @@ const VideoPlayer: React.FC = () => {
|
||||||
bottomOffset={subtitleBottomOffset}
|
bottomOffset={subtitleBottomOffset}
|
||||||
letterSpacing={subtitleLetterSpacing}
|
letterSpacing={subtitleLetterSpacing}
|
||||||
lineHeightMultiplier={subtitleLineHeightMultiplier}
|
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 */}
|
{/* Resume overlay removed when AlwaysResume is enabled; overlay component omitted */}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,10 @@ interface CustomSubtitlesProps {
|
||||||
outlineWidth?: number; // px
|
outlineWidth?: number; // px
|
||||||
align?: 'center' | 'left' | 'right';
|
align?: 'center' | 'left' | 'right';
|
||||||
bottomOffset?: number; // px from bottom
|
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;
|
letterSpacing?: number;
|
||||||
lineHeightMultiplier?: number; // multiplies subtitleSize
|
lineHeightMultiplier?: number; // multiplies subtitleSize
|
||||||
}
|
}
|
||||||
|
|
@ -38,6 +42,9 @@ export const CustomSubtitles: React.FC<CustomSubtitlesProps> = ({
|
||||||
outlineWidth = 2,
|
outlineWidth = 2,
|
||||||
align = 'center',
|
align = 'center',
|
||||||
bottomOffset = 20,
|
bottomOffset = 20,
|
||||||
|
controlsVisible = false,
|
||||||
|
controlsExtraOffset = 0,
|
||||||
|
controlsFixedOffset,
|
||||||
letterSpacing = 0,
|
letterSpacing = 0,
|
||||||
lineHeightMultiplier = 1.2,
|
lineHeightMultiplier = 1.2,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
@ -45,6 +52,13 @@ export const CustomSubtitles: React.FC<CustomSubtitlesProps> = ({
|
||||||
|
|
||||||
const inverseScale = 1 / zoomScale;
|
const inverseScale = 1 / zoomScale;
|
||||||
const bgColor = subtitleBackground ? `rgba(0, 0, 0, ${Math.min(Math.max(backgroundOpacity, 0), 1)})` : 'transparent';
|
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
|
// When using crisp outline, prefer SVG text with real stroke instead of blur shadow
|
||||||
const useCrispSvgOutline = outline === true;
|
const useCrispSvgOutline = outline === true;
|
||||||
|
|
@ -67,7 +81,7 @@ export const CustomSubtitles: React.FC<CustomSubtitlesProps> = ({
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
styles.customSubtitleContainer,
|
styles.customSubtitleContainer,
|
||||||
{ bottom: bottomOffset },
|
{ bottom: effectiveBottom },
|
||||||
]}
|
]}
|
||||||
pointerEvents="none"
|
pointerEvents="none"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue