-1

I have yet to find a way to play an youtube streaming video in Android Tv using leanback library. Any suggestions or pointers are greatly appreciated.

I noticed that it will play mp4 files but not live streams.

here is code that works:

movie1.setVideoUrl("http://commondatastorage.googleapis.com/android-tv/Sample%20videos/Demo%20Slam/Google%20Demo%20Slam_%2020ft%20Search.mp4");
mItems.add(movie1);

That works just fine.

But if I change it to a streaming video like the following:

movie1.setVideoUrl("http//livestreaming2.itworkscdn.net/squranlive/squran_360p");
mItems.add(movie1);

it will not show the video on the screen. it is blank and then crashes.

And when I use this code:

movie1.setVideoUrl("http://www.youtube.com/embed/VopbGPJVkzM");
mItems.add(movie1);

it just crashes

Also - i have to connect it to my android 5.0.1 tablet and android studio does not show the logcat output in Android Studio. What do I need to turn on as an option in Android Studio for the logcat output to be seen (from the device run of the application)?

Thanks everyone.

ironmantis7x

ironmantis7x
  • 807
  • 2
  • 23
  • 58
  • 1
    What's `movie1` in your code? Some class from the Leanback library? – david.mihola Dec 17 '15 at 19:58
  • No it is not a class. It is a variable. – ironmantis7x Dec 18 '15 at 00:21
  • Yes, sorry, my question was a bit imprecise. What I meant was: Is `movie1` *an instance of some class from the Leanback library*? Because I can't remember any classes in there that do actual video playback. Also, the `VideoView` from the Android API does not have that method (it has `setVideoURI`, though), nor any class in the ExoPlayer Library, nor has the `YouTubePlayerView` from the YouTube Android Player API. (The latter, BTW, is the one I would recommend for playing YouTube videos in your app.) – david.mihola Dec 18 '15 at 08:50
  • Good point. I will post the code where movie1 is from. Basically, it is for pass I g the video URI and it goes to another method. – ironmantis7x Dec 18 '15 at 21:46

1 Answers1

0

I found that if i make a YT intent and then call that intent as an activity, it works.

ironmantis7x
  • 807
  • 2
  • 23
  • 58