Skip to content

Commit

Permalink
chore: restore backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofMoch committed Mar 9, 2024
1 parent cf448f0 commit b2bce1e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,20 @@ type Source = ImageSourcePropType | ReactVideoSource;
export function resolveAssetSourceForVideo(
source: ReactVideoSource,
): ReactVideoSourceProperties {
// This is deprecated, but we need to support it for backward compatibility
if (typeof source === 'number') {
return {
uri: Image.resolveAssetSource(source).uri,
};
}

if (typeof source.uri === 'number') {
return {
...source,
uri: Image.resolveAssetSource(source.uri).uri,
};
}

return source as ReactVideoSourceProperties;
}

Expand Down

0 comments on commit b2bce1e

Please sign in to comment.