LiveStream APIに何か不具合がありますか?どのように3つの異なるソースは、まったく同じ摂取の3つの異なるライブストリーム名を表示できますか?LiveStream APIから作成した場合、LiveStreamとは異なる「ストリーム名」があります(API ExplorerとYouTubeページでAPI結果を確認しました)
何らかの理由で、挿入されたLiveStreamオブジェクトには、 というYouTube Webページと一致しない応答があります。この質問の
セクション:
- PHPコードのライブストリームのための
- APIの放送のためのPHPコード
- $ライブストリームに結果$ bindBroadcastResponseに&結合
- 応答
- YouTubeのライブストリームを挿入APIエクスプローラ
- リキャップ
- YouTubeのページで結果が
$streamSnippet = new \Google_Service_YouTube_LiveStreamSnippet(); $streamSnippet->setTitle($cameraName); $cdn = new \Google_Service_YouTube_CdnSettings(); $cdn->setFormat($cameraName); $cdn->setIngestionType('rtmp'); $streamInsert = new \Google_Service_YouTube_LiveStream(); $streamInsert->setSnippet($streamSnippet); $streamInsert->setCdn($cdn); $streamInsert->setKind('youtube#liveStream'); $liveStream = $youtube->liveStreams->insert('snippet,cdn',$streamInsert, array());
APIが$ライブストリーム放送用
Google_Service_YouTube_LiveStream Object ( [cdnType:protected] => Google_Service_YouTube_CdnSettings ... [etag] => "5C5HHOaBSHC5ZXfkrT4ZlRCi01A/lY9i12sOWOAkTwfchEAQUxEWdX8" [id] => UOzxsX96_We6MrMTsP5RiA1480670405575117 [kind] => youtube#liveStream ... [modelData:protected] => Array ( ... [cdn] => Array ( [format] => 1440p [ingestionType] => rtmp [ingestionInfo] => Array ( [streamName] => 9zfr-ggd9-brtf-XXXX [ingestionAddress] => rtmp://a.rtmp.youtube.com/live2 [backupIngestionAddress] => rtmp://b.rtmp.youtube.com/live2?backup=1 ) [resolution] => 1440p [frameRate] => 30fps ) ) ... )
PHPコードに結果のライブストリームのため
PHPコードと一致していません挿入&結合
$broadcastInsert = new \Google_Service_YouTube_LiveBroadcast();
$broadcastInsert->setSnippet($broadcastSnippet);
$broadcastInsert->setStatus($status);
$broadcastInsert->setKind('youtube#liveBroadcast');
$broadcastsResponse = $youtube->liveBroadcasts->insert('snippet,status',$broadcastInsert, array());
$bindBroadcastResponse = $youtube->liveBroadcasts->bind($broadcastsResponse['id'],'id,contentDetails',array('streamId' => $liveStream['id'],));
$ bindBroadcastResponseへの応答
Google_Service_YouTube_LiveBroadcast Object
(
...
[etag] => "5C5HHOaBSHC5ZXfkrT4ZlRCi01A/_2Jev_YmRlYUwMBX1ptq_Kp8uVs"
[id] => idd8f7dSLzk
[kind] => youtube#liveBroadcast
...
[modelData:protected] => Array
(
[contentDetails] => Array
(
[boundStreamId] => UOzxsX96_We6MrMTsP5RiA1480670405575117
...
)
)
)
YouTubeのライブストリームAPIエクスプローラ
私はLiveStream API Explorerを使用して、後ですべてのストリームを一覧表示する場合は、下の画像を参照してください、私は第三異なるました結果(下記のコードを参照)。
{
"kind": "youtube#liveStreamListResponse",
"etag": "\"5C5HHOaBSHC5ZXfkrT4ZlRCi01A/RGcoFd2XK9IZmX0hgw_pFxuaeC4\"",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#liveStream",
"etag": "\"5C5HHOaBSHC5ZXfkrT4ZlRCi01A/d-ptvs6HC_oItk2Kv2PtrovurCk\"",
"id": "UOzxsX96_We6MrMTsP5RiA1480670405575117",
"snippet": ...,
"cdn": {
"format": "1440p",
"ingestionType": "rtmp",
"ingestionInfo": {
"streamName": "1wzh-zjwb-b0fr-XXXX",
"ingestionAddress": "rtmp://a.rtmp.youtube.com/live2",
"backupIngestionAddress": "rtmp://b.rtmp.youtube.com/live2?backup=1"
},
"resolution": "1440p",
"frameRate": "30fps"
}
}
]
}
要約
PHP-> Google_Service_YouTube_LiveBroadcast[id] => idd8f7dSLzk
PHP-> Google_Service_YouTube_LiveStream->modelData[cdn][ingestionInfo][streamName] => 9zfr-ggd9-brtf-XXXX
API Explorer -> items[0].cdn.ingestionInfo.streamName => "1wzh-zjwb-b0fr-XXXX"
やYouTubeのページで結果が一致していません
これはhttp://stackoverflow.com/questions/18235664/difference-in-ingestation-settings-creating-a-live-event-using-youtube-api-vs-we?rq=と似ている可能性があります。 1、それはそうではありません。そのスレッドは長い時間前からあり、もはや適用されません。当時のAPIはv2で、今はv3になっています(私はv3 APIを使用しています) –
Googleで不具合を開いたばかりです:https://code.google.com/p/gdata-issues/issues/detail?id = 8814&q =ラベル%3AAPi-YouTube&sort = -id&colspec = API%20ID%20Type%20Status%20Priority%20Stars%20Summary –
まだ起こっています.... –