fix(android): disable caching on local asset files (#4304)

This commit is contained in:
Olivier Bouillet
2024-12-01 13:29:24 +01:00
committed by GitHub
parent 569a79c510
commit 63c592f7cd
6 changed files with 24 additions and 2 deletions

View File

@@ -151,6 +151,11 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
if (!_source) {
return undefined;
}
const isLocalAssetFile =
typeof _source === 'number' ||
('uri' in _source && typeof _source.uri === 'number');
const resolvedSource = resolveAssetSourceForVideo(_source);
let uri = resolvedSource.uri || '';
if (uri && uri.match(/^\//)) {
@@ -226,6 +231,7 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
uri,
isNetwork,
isAsset,
isLocalAssetFile,
shouldCache: resolvedSource.shouldCache || false,
type: resolvedSource.type || '',
mainVer: resolvedSource.mainVer || 0,

View File

@@ -35,6 +35,7 @@ export type VideoSrc = Readonly<{
uri?: string;
isNetwork?: boolean;
isAsset?: boolean;
isLocalAssetFile?: boolean;
shouldCache?: boolean;
type?: string;
mainVer?: Int32;

View File

@@ -24,6 +24,7 @@ export type ReactVideoSourceProperties = {
uri?: string;
isNetwork?: boolean;
isAsset?: boolean;
isLocalAssetFile?: boolean;
shouldCache?: boolean;
type?: string;
mainVer?: number;