react-native-youtube icon indicating copy to clipboard operation
react-native-youtube copied to clipboard

Handling RuntimeException thrown by YouTubeStandalonePlayer.getReturnedInitializationResult

Open luizppa opened this issue 3 years ago • 0 comments

I've noticed that when you have more than one app that can launch a standalone player for YouTube, your app will present a dialog for you to choose which app do you wish to use. If you close the dialog without choosing an option, the YoutubeStandaloneModule throws a RuntimeException that is not handled by the lib causing the app to crash.

Therefore I've wrapped the block inside a try catch and rejected the promise if the runtime error occurs.

I also fixed a few type definitions.

luizppa avatar Apr 19 '21 18:04 luizppa