1

I am currently working on a react native app. I am using react-native-video: https://github.com/react-native-community/react-native-video

I could not find something like an onClick() prop. What's the best way to implement a functionality for a click event on the video?

Toranksu
  • 65
  • 1
  • 7

1 Answers1

2

You should use touchablehighlight like this :

class MyVideoComponent extends React.Component {

  videoPressed() {
    console.log("Video pressed");
  }

  render() {
    return(
      <TouchableHighlight
        onPress={() => this.videoPressed()}
      >
        <YOURVIDEOCOMPONENT/>
      </TouchableHighlight>
    );
  }
}
sanjar
  • 1,081
  • 2
  • 9
  • 15