Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

VideoPlayer's onTapBack property is not called when the button is clicked. #18

Open
LearXD opened this issue Jun 10, 2023 · 0 comments
Open

Comments

@LearXD
Copy link

LearXD commented Jun 10, 2023

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>
  );
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant