Reputation: 1191
There are pretty much questions like this, I have looked through all of them but none had correct answer, or the correct answer is outdated due to youtube api changes. Before heading out to realm of documentation to find out best answer I would like to ask what is your way to stream youtube videos? I think using youtube player api and constraining user to have Youtube app installed is pretty much horrific approach
Using method suggested below I get and "Sorry this video cannot be played", even through I can play it using Youtube Player Api
07-03 16:58:47.139: D/MediaPlayer(20518): getMetadata
07-03 16:58:47.139: E/MediaPlayerService(82): getMetadata failed -38
07-03 16:58:47.680: E/ARTSPConnection(82): err = 111 (Connection refused)
07-03 16:58:47.680: I/MyHandler(82): connection request completed with result -111 (Connection refused)
07-03 16:58:47.740: E/MediaPlayer(20518): error (1, -2147483648)
07-03 16:58:47.740: E/MediaPlayer(20518): Error (1,-2147483648)
07-03 16:58:47.740: D/VideoView(20518): Error: 1,-2147483648
Upvotes: 3
Views: 3291