【问题标题】:Vevo Video not working using YoutubeAndroidPlayer api androidVevo Video 无法使用 YoutubeAndroidPlayer api android
【发布时间】:2018-01-30 12:17:25
【问题描述】:

我已集成 youtube Android 播放器,一切正常,但我无法在我的应用中播放 youtube Vevo 视频。我已经在 PlayStore 中发布了这个应用程序。

Vevo 视频在 google 提供的示例中播放得很漂亮。然后我通过创建新的 Android 应用程序来检查它,我只是从现有应用程序中复制了 youtube 集成代码,我播放了 Vevo 视频,它运行良好。我可以在我的新应用和示例应用中播放 Vevo 视频。但我无法在现有应用中播放。

最后我尝试了另一个选项我刚刚创建了另一个新应用程序,我使用了与我在 PlayStore 中发布的现有应用程序相同的包,并复制了 youtube 集成代码并尝试播放 Vevo 视频这次我无法播放 Vevo视频

注意:我已经为我现有的应用程序正确创建了 API 密钥。我已经使用现有的 API 密钥进行谷歌登录

我认为这个问题是由于 API 密钥而发生的,但我不知道为什么会发生我在 youtube 播放器中收到以下错误消息

视频包含来自 vevo 的内容。它被限制在某些网站或应用程序上播放

XML:

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

在这里我添加了我的功能。

@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

    }
}

【问题讨论】:

标签: android youtube youtube-api youtube-data-api


【解决方案1】:

这是因为我的应用程序包名称而发生的,我在应用程序包名称中使用了下划线。我从包名中删除了下划线(_),然后它运行良好。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-01-19
    • 1970-01-01
    • 1970-01-01
    • 2016-11-01
    • 2013-05-08
    • 2019-02-15
    • 2021-12-28
    相关资源
    最近更新 更多