6
votes

I'm developing an android app with Youtube android api..It was worked sucessfully upto last week.But now it shows an error,"

an error occurred while initializing the youtube player(network error)

Then i have tried the sample application with Youtube android api by developer forum.It also shows the same error..Please give me a solution

4
did you have network permission in your AndroidManifest.xml? If so, please share snippets of your code so I can take a look. - Ibrahim Ulukaya
@IbrahimUlukaya:yes..but the sample app developed by developer forum also shows the same error - mob_web_dev

4 Answers

1
votes

I can not reproduce the error. I am using the sample application with Youtube Android Api on my Nexus 7, and the last version of the YouTube app.

Maybe it is related to the problem mentioned here:

YouTube intent, error 400

You can try the workaround mentioned "log out of the youtube app and then log in again."

0
votes

Try this solution on a Google product forums which helped to solve my problem - which was similar to the problem you're experiencing :)

SOLUTION: Give ONLY the YouTube ID and not the entire YouTube URL to the loadVideo() function.

0
votes

Try this for 400 error..

Check your id .I think there is space in id or youtube url either start or end .I have similar problem and solved by this .You should also try .It may be help for if you dave setup all properly .

0
votes

I encountered the same issue. I recognized that the youtube app was having an update available and could not be used therefore. After installing the update everything worked fine again. It looks like the app is somehow blocking the API when an update needs to be installed.