feat: add setSource API function fix ads playback (#4185)

* feat: add setSource API function fix ads playback
This commit is contained in:
Olivier Bouillet
2024-10-10 22:59:41 +02:00
committed by GitHub
parent 4c9db2845b
commit 9a3fcda3b8
10 changed files with 189 additions and 133 deletions

View File

@@ -252,6 +252,10 @@ const VideoPlayer: FC<Props> = ({}) => {
cacheSizeMB: useCache ? 200 : 0,
};
useEffect(() => {
videoRef.current?.setSource(currentSrc)
}, [currentSrc])
return (
<View style={styles.container}>
<StatusBar animated={true} backgroundColor="black" hidden={false} />
@@ -261,7 +265,7 @@ const VideoPlayer: FC<Props> = ({}) => {
<Video
showNotificationControls={showNotificationControls}
ref={videoRef}
source={currentSrc as ReactVideoSource}
// source={currentSrc as ReactVideoSource}
adTagUrl={additional?.adTagUrl}
drm={additional?.drm}
style={viewStyle}