How to use the react-native-youtube.YouTubeStandaloneAndroid.playVideos 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.playVideos({
                  apiKey: 'YOUR_API_KEY',
                  videoIds: ['HcXNPI-IPPM', 'XXlZfc1TrD0', 'czcjU1w-c6k', 'uMK0prafzw0'],
                  autoplay: false,
                  lightboxMode: true,
                  startIndex: 1,
                  startTime: 99.5,
                })
                  .then(() => {
                    console.log('Android Standalone Player Finished');
                  })
                  .catch(errorMessage => {
                    this.setState({ error: errorMessage });
                  });
              }}
            />