Reputation: 18237
In YouTube streaming API we can create a broadcast and stream, but how do I actually start streaming?
I mean, when we create a broadcast with the browser, we have to click the "preview button" first. And when YouTube receives streaming content, then we can click on the "broadcast button".
What is the equivalent API call for this? Pointing to either Java, Python, or PHP API is fine for me, thanks.
Upvotes: 1
Views: 1084
Reputation: 7345
As the documentation for live broadcast transition states:
Changes the status of a YouTube live broadcast and initiates any processes associated with the new status. For example, when you transition a broadcast's status to testing, YouTube starts to transmit video to that broadcast's monitor stream. Before calling this method, you should confirm that the value of the status.streamStatus property for the stream bound to your broadcast is active.
The broadcastStatus parameter identifies the state to which the broadcast is changing. Note that to transition a broadcast to either the testing or live state, the status.streamStatus must be active for the stream that the broadcast is bound to.
Acceptable values for the broadcastStatus
parameter are:
Upvotes: 1
Reputation: 332
POST https://www.googleapis.com/youtube/v3/liveBroadcasts/transition
When setting broadcastStatus to live you're going live. When setting it to testing YouTube only transmits video to the broadcast's monitor stream.
More info here https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/transition
Upvotes: 1