0

I want to use YouTubeStandalonePlayer on AndroidTV as I need to start Youtube video playback using startActivityForResult() so that I can get response to my app when playback has stopped/youtube closed.

But the Youtube activity not started giving ActivityNotFoundException. Further to analyze this I put the below check as suggested by: Youtube API ActivityNotFoundException on Gingerbread and I see that following check indeed fails:

(YouTubeApiServiceUtil.isYouTubeApiServiceAvailable(context).equals(YouTubeInitializationResult.SUCCESS))

Any help on how this can be supported on AndroidTV or am I missing something?

v.j
  • 186
  • 11
  • 1
    related : https://stackoverflow.com/q/36184556/2614364 – Bertrand Martel Jul 12 '17 at 17:46
  • Thanks for the link. I still want to investigate if there is another way avoiding YouTubeStandalonePlayer and use startActivityForResult() to start the playback but still guarantees that my app gets back the result once youtube playback has stopped? – v.j Jul 13 '17 at 01:30
  • I investigated usage of startActivityForResult() and onActivityresult() inside my app activity/framgment and could use but onActivityresult() is not reliable when another app comes over YoutubeApp. Because in such case -YoutubeApp does not send onActivtyResult() back to my App and my app does not know playback has ended. So indeed have to follow suggestions mentioned in https://stackoverflow.com/questions/36184556/use-youtube-api-in-android-tv to have a better control over Youtube playback in AndroidTV – v.j Jul 14 '17 at 06:33

0 Answers0