0
votes

I have integrated youtube Android player, everything works perfectly but I cannot play youtube Vevo videos in my app. I have already published this app in PlayStore.

Vevo videos playing beautifully in sample given by google. And then I checked it by creating new Android app and I just copied youtube integration code from existing app and I played the Vevo video it's worked well. I can play Vevo videos in my new app and also in sample app. but I can't play it in existing app.

Finally I tried another option I just created another new app and I used the same package of my existing app that I published it in PlayStore and copied the youtube integration code and tried to play Vevo video this time I can't play Vevo video

Note : I have created API keys properly for my existing app. I have already using existing API key for google sign in

I thing this issue happened because of API key but I don't know why it's happening I got the below error message in youtube player

video contains content from vevo. it is restricted from playback on certain sites or applications

XML :

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

Here I have added my functionality.

@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player,
                                    boolean wasRestored) {
    this.player = player;
    this.wasRestored = wasRestored;
    //https://developers.google.com/youtube/android/player/reference/com/google/android/youtube/player/YouTubePlayer
    //Here we have all abstract method to play video in this above link

    //loadVideos(List<String> videoIds, int startIndex, int timeMillis)
    // Loads and plays a list of videos.

    // Specify that we want to handle fullscreen behavior ourselves.
    player.addFullscreenControlFlag(YouTubePlayer.FULLSCREEN_FLAG_CUSTOM_LAYOUT);
    player.setOnFullscreenListener(this);
    if (!wasRestored) {
        player.cueVideos(VIDEO_IDS, 0, 1);
        //   player.loadVideoVIDEO_IDS, 0, 1);// where video.id is a String of a Youtube video ID

    }
}
1
@skadoosh Thanks for sharing thisMathankumarK

1 Answers

0
votes

It's happened because of my app package name, I used underscore in my app package name. I removed underscore(_) from my package name and then it works well.