How to use the react-native-youtube.YouTubeStandaloneAndroid.playPlaylist function in react-native-youtube

To help you get started, we’ve selected a few react-native-youtube examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inProgress-team / react-native-youtube / example / ReactNativeYouTubeExample.js View on Github external
onPress={() => {
                YouTubeStandaloneAndroid.playPlaylist({
                  apiKey: 'YOUR_API_KEY',
                  playlistId: 'PLF797E961509B4EB5',
                  autoplay: false,
                  lightboxMode: false,
                  startIndex: 2,
                  startTime: 100.5,
                })
                  .then(() => {
                    console.log('Android Standalone Player Finished');
                  })
                  .catch(errorMessage => {
                    this.setState({ error: errorMessage });
                  });
              }}
            />