1

I recently have updated YouTube Android Player API to 1.2.2 (the latest version), but it keeps telling me

16445-16445/com.* W/YouTubeAndroidPlayerAPI﹕ Cannot load modern controls UI. Upgrade to the latest version of the Android YouTube API.

, when I try to put a video on the fullscreen mode. In addition, the video stops playing and it appears, that it can’t be played anymore (it stucks). What’s even worse, when you press back, it does not allow you to play the video in normal mode, so, basically, you have to reload the activity. I’m using YoutubePlayerSupportFragment. I guess, that the general YouTube app update might have ruined it. I have noticed, that the full screen mode worked smoothly before.

How to overcome with this problem? Thanks in advance.

Sharptax
  • 75
  • 1
  • 10

1 Answers1

1

When you extend AppCompatActivity, It causes 2 following problems:

  1. It causes error UNAUTHORIZED_OVERLAY when playing in fullscreen. Because the statusbar is on the top of YoutubePlayer.
    Solution: set FULLSCREEN_FLAG_CUSTOM_LAYOUT to hide the status bar manually.

  2. YouTubeAndroidPlayerAPI﹕ Cannot load modern controls UI. Upgrade to the latest version of the Android YouTube API.
    The UI of YoutubePlayer looks so bad. It just happens when extending AppCombatActivity. Updating the latest youtube api doesn't work.
    If you find the solution of the 2nd problem, please let me know.

Huy Duong Tu
  • 7,798
  • 5
  • 25
  • 46
  • For the second problem. use getLayoutInflater().setFactory(this); in onCreate function but before super.onCreate . I have been testing that there is no problem so far. However, it may cause some problems for some other apps and devices. – faraway Dec 03 '15 at 14:15