youtube - 如何获取 youtube live api 流 key

标签 youtube youtube-data-api

如何绑定(bind)我的 YouTube 流 key 以匹配以前的视频。
我正在尝试使用java来做到这一点,但没有得到任何地方。

我正在查看为创建广播流而给出的示例,但它没有保持相同的 key 。

最佳答案

我以前得到过这方面的帮助。请尝试在 Google 上进行一些研究,然后提出问题。可以看How can I change the stream my event uses via the YouTube live api? .这会像对我一样帮助你。

简而言之,这是我收到的帮助代码。

Credit to @M. Prokhorov


YouTube yt = ...         // your reference to YouTube
String broadcastId = ... // your broadcast Id

String newStreamId = ... // identifier of stream you want to bind
String apiKEy = ...      // your API key

// you can define other response parts if you want more or don't want some of these
String responseParts = "id,status,contentDetails.boundStreamId";

yt.liveBroadcasts().bind(broadcastId, responseParts)
    .setApiKey(apiKey)
    .setStreamId(streamId)
    // other data you might want in request
    .execute()

关于youtube - 如何获取 youtube live api 流 key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58185499/

相关文章:

android - youtube视频无法使用 Intent 工作,但可以使用浏览器工作

android - 通过 android 在 youtube 上直播时处于非 Activity 状态

youtube - YouTube API设置尺寸

html - 如何在 div 内的移动设备上调整 YouTube 视频的大小?

javascript - 如何将嵌入的 YouTube 视频静音?音量 = 0 不起作用

youtube - 使用 YouTube Data Api 会产生任何费用吗?

youtube - 如何通过 YouTube API 获取用户链接?

ajax - 使用 YouTube API 时的两个问题 : Browser Key not working and username/channel name not working

python - Youtube GData观看次数最高为2000

php - 使用youtube API获取有关youtube channel 的受众特征信息