Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred while initializing the youtube player. #100

Closed
dozel opened this issue Jan 14, 2017 · 6 comments
Closed

An error occurred while initializing the youtube player. #100

dozel opened this issue Jan 14, 2017 · 6 comments

Comments

@dozel
Copy link

dozel commented Jan 14, 2017

I've added the following code in the RN project, but keep getting the 'An error occurred while initializing the youtube player.' error only on Android (emulator). On iphone it runs beautifully.

<YouTube
ref="youtubePlayer"
videoId="KVZ-P-ZI6W4" // The YouTube video ID
play={true} // control playback of video with true/false
hidden={false} // control visiblity of the entire view
playsInline={false} // control whether the video should play inline
loop={false} // control whether the video should loop when ended
apiKey={'API_KEY'}
style={{alignSelf: 'stretch', height: 300, backgroundColor: 'black', marginVertical: 10}}
/>

What could be the possible problems causing this error?

Thanks!

@labithiotis
Copy link

I'm also experiencing the same issue on RN0.36. I have followed the readme to the letter and recompiled the app and still have the issue.

@ilyadoroshin
Copy link

ilyadoroshin commented Jan 15, 2017

same for me.. does it have anything to do with running it on android-emulator? Is it even possible to make it work in android-emulator?
#97

@morelazers, please help!

@morelazers
Copy link

@ilyadoroshin I can't remember if I managed to get it to work in android emulator. I think that you need the YouTube app installed on the device for it to function on Android. I am not sure if you can install the app on emulator.

If you have a device to test on definitely try that instead. Otherwise the iOS simulator should work.

@dozel dozel closed this as completed Jan 17, 2017
@ilyadoroshin
Copy link

@morelazers YouTube app worked splendidly! Thanks!

@bilal-tariq786
Copy link

bilal-tariq786 commented Feb 23, 2021

add the below lines of code into your android AndroidManifest.xml file

  <queries>
    <intent>
      <action android:name="com.google.android.youtube.api.service.START" />
    </intent>
  </queries>

@BilalTariq01
Copy link

add the below lines of code into your android AndroidManifest.xml file

  <queries>
    <intent>
      <action android:name="com.google.android.youtube.api.service.START" />
    </intent>
  </queries>

https://stackoverflow.com/a/66330541/15265413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants