react-native-youtube
react-native-youtube copied to clipboard
Handling RuntimeException thrown by YouTubeStandalonePlayer.getReturnedInitializationResult
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.