1

I'm trying to stream youtube 360 videos using the MediaPlayer class. Few solutions which I found (this, this and this) suggested using the google api to get RTSP links to youtube videos. However, that API is deprecated and also had problems with a low quality stream.

The other solution was showing the video in a Webview, which doesn't work for me as I need to show the video in a split window cardboard mode for Google Cardboard along with controlling the playback. The same thing with the Youtube player API which doesn't seem to have a Cardboard mode.

I could download the video and show but I'm trying to avoid that.

Is there any other way to stream youtube video inside an android app? If not, would appreciate if someone could direct me to an quick way to setup a RTSP stream.

Thanks

Community
  • 1
  • 1
vepzfe
  • 4,217
  • 5
  • 26
  • 46

1 Answers1

0

You probably have to use com.google.android.youtube.player.YouTubePlayer

It's really simple, you just implement the view it like you normally would, and pass the video ID to it. Apologies if you've tried this already!

yosriz
  • 10,147
  • 2
  • 24
  • 38
MSpeed
  • 8,153
  • 7
  • 49
  • 61
  • This was my very first approach. However, Youtube Player API does not provide the option to view a video in the Cardboard split screen mode, like they do in the Youtube app itself. Maybe they'll implement this sometime in the future. I've already asked about this in a SO question [here](http://stackoverflow.com/questions/42840077/how-to-enable-cardboard-mode-in-youtube-android-player-api). Still waiting for someone from the youtube team or anyone to answer. Thanks for your answer. – vepzfe Mar 31 '17 at 14:57