chore: move minLoadRetryCount into source property (#4233)

This commit is contained in:
Olivier Bouillet
2024-10-16 23:41:22 +02:00
committed by GitHub
parent a8d5841c7c
commit f04b233a40
7 changed files with 35 additions and 17 deletions

View File

@@ -124,6 +124,7 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
onVideoTracks,
onAspectRatio,
localSourceEncryptionKeyScheme,
minLoadRetryCount,
...rest
},
ref,
@@ -233,6 +234,8 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
? {adTagUrl: adTagUrl, adLanguage: adLanguage}
: undefined);
const _minLoadRetryCount =
_source.minLoadRetryCount || minLoadRetryCount;
return {
uri,
isNetwork,
@@ -253,6 +256,7 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
textTracks: _textTracks,
textTracksAllowChunklessPreparation:
resolvedSource.textTracksAllowChunklessPreparation,
minLoadRetryCount: _minLoadRetryCount,
};
},
[
@@ -261,6 +265,7 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
contentStartTime,
drm,
localSourceEncryptionKeyScheme,
minLoadRetryCount,
source?.cmcd,
textTracks,
],

View File

@@ -50,6 +50,7 @@ export type VideoSrc = Readonly<{
textTracksAllowChunklessPreparation?: boolean; // android
textTracks?: TextTracks;
ad?: AdsConfig;
minLoadRetryCount?: Int32; // Android
}>;
type DRMType = WithDefault<string, 'widevine'>;
@@ -362,7 +363,6 @@ export interface VideoNativeProps extends ViewProps {
disableDisconnectError?: boolean; // Android
focusable?: boolean; // Android
hideShutterView?: boolean; // Android
minLoadRetryCount?: Int32; // Android
reportBandwidth?: boolean; //Android
subtitleStyle?: SubtitleStyle; // android
viewType?: Int32; // Android

View File

@@ -39,6 +39,7 @@ export type ReactVideoSourceProperties = {
textTracksAllowChunklessPreparation?: boolean;
textTracks?: TextTracks;
ad?: AdConfig;
minLoadRetryCount?: number; // Android
};
export type ReactVideoSource = Readonly<
@@ -305,6 +306,7 @@ export interface ReactVideoProps extends ReactVideoEvents, ViewProps {
fullscreenOrientation?: EnumValues<FullscreenOrientationType>; // iOS
hideShutterView?: boolean; // Android
ignoreSilentSwitch?: EnumValues<IgnoreSilentSwitchType>; // iOS
/** @deprecated Use source.minLoadRetryCount */
minLoadRetryCount?: number; // Android
maxBitRate?: number;
mixWithOthers?: EnumValues<MixWithOthersType>; // iOS