亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

通過 API 啟動 YouTube 直播

通過 API 啟動 YouTube 直播

PHP
守著星空守著你 2023-10-15 16:48:06
我遇到了 YouTube API 的問題,我正在使用 ("google/apiclient": "2.7")我已經創建了廣播并將其綁定到流,然后將 RTMP URL 作為端點添加到我的直播中但我找不到在 YouTube 上啟動直播的方法(在原始直播開始后)   $access_token = $data['yt-access-token'];        $title = $data['title'];        $description = $data['description'];        //=======================================//        $client = new Google_Client();        $client->setClientId(env('GOOGLE_APP_ID'));        $client->setClientSecret(env('GOOGLE_SECRET'));        $client->setScopes('https://www.googleapis.com/auth/youtube');        $client->setAccessToken($access_token);        // Define an object that will be used to make all API requests.        $youtube = new Google_Service_YouTube($client);        //=======================================//        try {            // Create an object for the liveBroadcast resource's snippet. Specify values            // for the snippet's title, scheduled start time, and scheduled end time.            $broadcastSnippet = new Google_Service_YouTube_LiveBroadcastSnippet();            $broadcastSnippet->setTitle($title);            $broadcastSnippet->setDescription($description);            $broadcastSnippet->setScheduledStartTime('2020-08-20T00:00:00.000Z');            $broadcastSnippet->setScheduledEndTime('2020-08-25T00:00:00.000Z');                    // Create an object for the liveBroadcast resource's status, and set the            // broadcast's status to "private".            $status = new Google_Service_YouTube_LiveBroadcastStatus();            $status->setPrivacyStatus('public'); //private or public                    // Create the API request that inserts the liveBroadcast resource.            $broadcastInsert = new Google_Service_YouTube_LiveBroadcast();            $broadcastInsert->setSnippet($broadcastSnippet);            $broadcastInsert->setStatus($status);            $broadcastInsert->setKind('youtube#liveBroadcast');                )            );我在 YouTube 管理室中找到了這些選項,但在 API 中找不到它們有什么解決辦法嗎?
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關注
  • 173 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號