Youtube api v3 - 如何在新事件上设置流键

问题描述 投票:0回答:1

我在youtube工作室中创建了很少的流密钥

enter image description here

使用此示例代码,我可以创建一个新事件,但它总是创建一个新流(在此示例中称为New Stream),我想知道,我如何设置/强制使用以前的流密钥(例如cam1profile)

工作代码来自enter link description here,只是用我的api键修改

php youtube-api youtube-data-api live-streaming
1个回答
0
投票

好的,我得到了解决方案,只需要找出我想要使用的流ID并将其绑定到广播

$stream_id='ls7ACzSkqopkYLg2N3ghmQ15498827578945';
$bindBroadcastResponse = $youtube->liveBroadcasts->bind(
    $broadcastsResponse['id'],'id,contentDetails',
        array(
            'streamId' => $stream_id,
        ));
© www.soinside.com 2019 - 2024. All rights reserved.