0

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.

Chrishan
  • 4,076
  • 7
  • 48
  • 67

2 Answers2

2

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.

Leon Nicholls
  • 4,623
  • 2
  • 16
  • 17
  • My app works great in android devices. But in google tv it won't play. Is there any specific stuff to do when using Youtube API for Google TV ? – Chrishan May 05 '13 at 05:17
  • Even your app doesn't work with my emulator. May be I have done something wrong when creating the Emulator. – Chrishan May 05 '13 at 09:33
  • The emulator does not support all the GTV features. Did you check the YouTube app version on your GTV device? Which GTV device are you using? Also, GTV devices will only support certain video formats: https://developers.google.com/tv/android/docs/gtv_media_formats – Leon Nicholls May 05 '13 at 12:19
  • As of version 1.7.1 of the Youtube Player on GTV, this app fails to load "INTERNAL ERROR", there is a issue opened w google: https://code.google.com/p/gdata-issues/issues/detail?id=4585#makechanges – Jakub Aug 23 '13 at 15:28
0

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

Matias Molinas
  • 2,246
  • 15
  • 11