Question

I have develop an Android application using YouTube Android API. Now I need my application to be able to run in Google TV devices. But my application does not work in Google TV device/Emulator. So I try the sample application which comes with YouTube library. even its not working in Google TV.

Is YouTube Android API really compatible with Google TV ? If so why it is not working in Google TV ?

My logcat out put says media player error during the playback.

YouTubeAndroidPlayerAPI : MediaPlayer error during playback [what=1, extra=-2147483648]
YouTubeAndroidPlayerAPI : Retrying MediaPlayer error [retry=3, max=3]
AwesomePlayer           : setDataSource_l('http://redirector.c.youtube.com/videoplayback?id=7b25376d1cb6c78e&itag=22&source=youtube&uaopt=no-save&upn=drkvZj2MXOc&el=videos&devKey=AWMUQlKSGtkK9UUmJNGoTUgO88HsQjpE1a8d1GxQnGDm&app=youtube_gdata&ip=0.0.0.0&ipbits=0&expire=1367719435&sparams=id,itag,source,uaopt,upn,ip,ipbits,expire&signature=5AC58E1E3D89EB15227C062654CBA43017C92F4A.46152ACA146CC324100BBED7DC27C8C234614D35&key=yta2&dnc=1')
NuHTTPDataSource        : connect to redirector.c.youtube.com:80/videoplayback?id=7b25376d1cb6c78e&itag=22&source=youtube&uaopt=no-save&upn=drkvZj2MXOc&el=videos&devKey=AWMUQlKSGtkK9UUmJNGoTUgO88HsQjpE1a8d1GxQnGDm&app=youtube_gdata&ip=0.0.0.0&ipbits=0&expire=1367719435&sparams=id,itag,source,uaopt,upn,ip,ipbits,expire&signature=5AC58E1E3D89EB15227C062654CBA43017C92F4A.46152ACA146CC324100BBED7DC27C8C234614D35&key=yta2&dnc=1 @0
AwesomePlayer           : reset
AwesomePlayer           : cancel player events
AudioService            : AudioFocus  abandonAudioFocus() from android.media.AudioManager@a6d87f98com.google.android.youtube.api.t@a6d7b380
AwesomePlayer           : video decoder shutdown completed

FYI : AwesomePlayer is not a tag defined by me.

Was it helpful?

Solution

Yes, it does work on Google TV, but you need to have version 1.6 (4845) of the YouTube app (or higher).

All of the YouTube API sample apps work on GTV: https://developers.google.com/youtube/android/player/sample-applications

You can play HD videos using the YouTube API which looks great on a TV.

I have open-sourced a GTV app that uses the YouTube API: https://github.com/entertailion/Video-Wall

The app shows a video wall of thumbnail images for videos in a YouTube playlist. One of the thumbnails will flip over and begin playing a video from the playlist, which will play until it finishes. After that, the video will be replaced with a thumnbail, and a different thumbnail will flip over to play another video.

OTHER TIPS

I don't have a Google TV device to test it, but should work on that device.

These resources may be useful:

https://developers.google.com/tv/android/docs/gtv_demo_samples

http://www.youtube.com/watch?v=ULTQ4J5Em40

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top