1

Following warning showing on Youtube player playing in android app:

W/YouTubeAndroidPlayerAPI: Forcefully created overlay:wjs@a21190b helper:Lazy@f3b33e8 view:null status: ...... {...}

XML File:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.xyz.abc.YoutubePlayerActivity">

    <com.google.android.youtube.player.YouTubePlayerView
        android:id="@+id/youtube_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>

And my activity code is:

@Override
    public void onInitializationSuccess(Provider provider, YouTubePlayer player, boolean wasRestored) {
        if (videoID != null) {
            youTubePlayer = player;
            if (youTubePlayer != null) {
                if (wasRestored) {
                    player.play();
                } else {
                    try {
                        player.loadVideo(videoID,0);
                    } catch (IllegalStateException e) {
                        youTubeView.initialize(YouTubeConstants.youtube_API_key, this);
                    }
                }
                player.setFullscreenControlFlags(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_ORIENTATION);
            }
        }
    }

Any solution about this?

Saggy
  • 465
  • 5
  • 18
  • I wouldn't worry about this. – natario Aug 06 '17 at 16:38
  • From this [SO post](https://stackoverflow.com/questions/42835909/multiple-youtubeplayerview-in-one-activity), you can only host one video player per activity. Try to use `ThumbNailViews` which will launch one `YouTubePlayerView`. Although this is the intended behavior based on this [link](https://stackoverflow.com/questions/17117164/android-multiple-youtube-videos-in-activity) because the YouTube Android Player SDK is enforcing a one-video-at-a-time limitation. – abielita Aug 07 '17 at 13:41

0 Answers0