Any way to Keep LiveStream active on Youtube Livestream? - youtube

I'd like to livestreaming my lectures to Youtube with youtube-livestreaming-api.
I create new live events when the lectures start and I transit my LiveEvent to completion when the lectures end.
The problem is break-time. when break-time short, I don't need to change or insert LiveStream because the Live Stream is still active even though LiveEvents stop. The problem is when the break-time long, the Live Stream turns to inactive. so I can't transition to testing and live. Is there any way to keep LiveStream active?
Any Suggestion? or Any Idea?

You may use the LiveBroadcasts:transition and should confirm that the value of the status.streamStatus property for the stream bound to your broadcast is active
A liveStream resource contains information about the video stream that you are transmitting to YouTube. The stream provides the content that will be broadcast to YouTube users.
HTTP request
POST https://www.googleapis.com/youtube/v3/liveBroadcasts/transition
Note: This request requires authorization with at least one of the following scopes.
The parameter broadcastStatus identifiees the state of which the broadcast is changing. Note that to transition a broadcast to either the testing or live state. live is visible to its audience. YouTube transmits video to the broadcast's monitor stream and its broadcast stream.

Related

How to identify if a video is a Premiere? ...via the YouTube API

On YouTube we have uploads of recorded videos, live streams, and now also Premieres.
Using the Videos: list endpoint of the YouTube Data API we can distinguish recorded videos from live streams by calling the endpoint with the liveStreamingDetails part. If details are given then it is a live stream. If not then it is a regular upload of a recorded video.
This approach doesn’t help me with identifying Premieres. They appear as if they were live streams. At least with the endpoint above I see no difference between live streams and Premieres.
Is there any way to check if a video is in fact a Premiere? I have the video id and want to achieve this by calling any of YouTube’s APIs.
Edit: The way I implemented this, I look for snippet.liveBroadcastContent, which is either 'upcoming', 'live' or 'none'.
This way you can identify if a video is currently a premiere, or the premiere has ended and it's a regular video.

Going live in Youtube by using embedded player in the application is a violation?

I am building an app which does live streaming to Youtube channel using an embedded player. So i want to know if it violates the policy of Youtube since I am using a different application to do live to the youtube Also, all the application users will stream to a single youtube channel, so any idea in how many live streams can take place at a time?
It was stated in the Broadcast and Stream documentation of the YouTube API that "only one event is live at any given time, and the video content for each broadcast is unique". To learn more about policy, you can read the YouTube API developer policies.

Push Notifications for new live broadcasts via PubSubHubbub

I would like to receive notifications on new live broadcasts of YouTube channels. As described in YouTube v3 Push Notifications I've set up a public accessible PubSubHubbub callback server and subscribed to my own YouTube channel where I've tested the callbacks for "normal videos" and for live broadcasts. The subscription returned a HTTP 204 and I am getting pings for
new videos
changes of videos
deletion of vides
However I do not get a Ping when a live broadcast starts. It is visible on the YouTube channel, you can view it, use the chat, the live dashboard says everything is fine. So that part is okay. But there is no ping to the PubSubHubbub callback server for new live broadcasts.
However if I change the title or the description in the live dashboard there is a ping for the current live broadcast.
For me it looks like that there is only a "onChange" for live broadcasts, but no "created" ping. Is there anything I can do to get the missing calls for new live broadcasts?
Regards,
wlami
Edit: Once I stop the live broadcast I get two update Pings once the broadcast has been processed and is shown as a video on the channel.
Youtube Notifications via PubSubHubbub states in the docs that this is meant for:
uploads a video updates
a video's title updates
a video's description
No mention of new live broadcast here.

How to get the preview monitor work through Livestream API

I'm using Livestream API to transition a stream from "ready" to "testing". And after successful transition to "testing",
the response returned with contentDetails object with monitorStream.embedHtml.
But the embedded html with the livemonitor, is displaying "sign in to view this video". My app is already authorized with OAuth 2.0.
Isn't it possible to view the Preview through the embedded html?
It is possible, according to this document - Stage 3: Test,
you embed a player that shows the monitor stream for your broadcast so that you can test the viewing experience.
Follow the steps:
Embed a monitor stream player
Retrieve your broadcast using the liveBroadcasts.list method, and extract the value of the contentDetails.streamDetails.monitorStreamEmbedHtml property. That value contains the HTML that you need to embed a YouTube player that shows your monitor stream.
Start your video
Start transmitting video on your video stream.
Following this should help you preview your livestream for testing. You may also check how you authorize your request since a sign in is being display to view the video.
NOTE:
The monitor stream is a private stream that lets you preview the broadcast video as it would appear to YouTube viewers. Note that you can only test your video broadcast if its monitor stream is enabled.
Hope this helps.

Is it possible to use the YouTube Live Stream API to broadcast through my phone camera?

I want to create a basic app that allow users to simply start to broadcast a video through their phone camera (front and back) just by pressing a button.
Does the YouTube live stream API allow me to handle the video streaming process?
If so, is YouTube Live Stream API totally free of charges and will never ask me to pay something if I reach a certain amount of usage?
Creating a Live Event and Live broadcast is language and hardware agnostic, just use YouTube's Live Streaming HTTP API. Read through the Core Concepts and Life of a Broadcast guides.
Your flow might look something like this:
Authenticate the user.
Set up and schedule your Live Broadcast object.
Start your video encoder and create a Live Stream Object.
Bind your Live Stream to your Live Broadcast.
Test to verify your video is going through.
Set your Live Broadcast to Live.
At the conclusion of your event, set your Live Broadcast to Ended.
Note that setting up your encoder is on you. Asking "How do I create an RTMP or DASH video encoder for [hardware or software]" is too broad of a question for Stack Overflow.
The YouTube API is free to use within a specific quota. If you hit that quota limit, there are ways to request additional quota from Google (potentially for a fee).
I answered a similar question about integrating with YouTube's Live Streaming API on iOS here: YouTube live on iOS?

Resources