Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YouTube Android Player API INTERNAL_ERROR for multiple videos

Using the YouTube Android Player API sample code (version 1.2.2), if I change any of the video IDs over to one I have uploaded (e.g. "QVikru_w2hQ" or "u1n6E81rm80"), the thumbnail loads in the player, but on clicking play, the player goes to the onError function with YouTubePlayer.ErrorReason.INTERNAL_ERROR. A message is displayed saying "There was a problem while playing. Tap to retry". Playing these videos on the YouTube website or our iOS app does not have a problem. The original sample videos play fine with my developer key.

I am experiencing this issue on multiple devices, including my Nexus 5X (android 6.0.1) with YouTube app version currently at 11.13.56.

Has anyone else experienced a similar issue?

I have also posted a potential bug report on google data api issue tracker.

like image 282
Jon G Avatar asked May 04 '16 10:05

Jon G


1 Answers

The WebView seems to be a good solution. Because I was in a rush and needed a quick fix, I used the source code from this github project :

https://github.com/theScrabi/NewPipe

This code does not rely on the Youtube API. It is pure web parsing. All my videos are working fine with the solution, as fast as before.

The whole project is a functional app, but you can dive inside and take what you need. I used the fragment which embeds the video thumbnail and the fullscreen player activity.

Kudos to the author of the project.

like image 87
batistomorrow Avatar answered Nov 15 '22 00:11

batistomorrow