Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
This repository was 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

@LearXD

Description

@LearXD

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>
  );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions