VideoPlayer's `onTapBack` property is not called when the button is clicked.
LearXD opened this issue · comments
Miguel S. Pinheiro commented
I tried to implement the logic below, I want to make the user go back to the previous screen when clicking on the backButton, but the event is not triggered!
My code:
export const VideoScreen = function (props: VideoScreenProps) {
const navigation = useNavigation()
const videoRef = React.useRef<VideoPlayerRef>();
const videoHeight = useSharedValue(width * (9 / 16));
const isFullScreen = useSharedValue(false);
const [paused, setPaused] = useState(false);
return (
<SafeAreaProvider>
<GestureHandlerRootView >
<VideoPlayer
ref={videoRef}
navigation={navigation}
theme={{
minimumTrackTintColor: Colors.primary,
bubbleBackgroundColor: Colors.primary,
}}
source={{
uri: 'my url goes here!'
}}
onTapBack={() => {
console.log('onTapBack') // <--------- does not print on the console when clicking on the backButton
Alert.alert('onTapBack');
}}
headerBarTitle={'Darling in the Franxx'}
onPausedChange={setPaused}
videoHeight={videoHeight}
paused={paused}
isFullScreen={isFullScreen}
/>
</GestureHandlerRootView>
</SafeAreaProvider>
);
}