Livestream webhooks

Today we are happy to announce our Live Webhooks.

There are 3 new webhooks that can be subscribed to:

1.live-stream.broadcast.started: when a live stream starts, it’s broadcasting status changes from false to true, and this webhook will fire.
2. live-stream.broadcast.ended: when a live stream stops encoding, it’s broadcasting status changes from true to false, and this webhook will fire.
3. video.source.recorded: When a livestream ends, and it is set to be recorded, this webhook will fire when the recording is ready for playback. This webhook is very similar to video.encoding.quality.completed, but will only fire for recorded live streams.

Additionally, if you already use video.encoding.quality.completed, the livestreamId will be added to any recording encoded alert.

You can see the broadcast started and ended events at https://webhook.a.video. Whenever a livestream starts or ends (You can do this at https://livestream.a.video or https://record.a.video), the event will appear in this listing.

Try out our new live webhooks, and tell us what you think!

6 Likes

Awesome, can’t wait to try it :slight_smile:

Will you be adding events for users coming and going from the live feed? This seems like as good as place as any to have access to that info.

1 Like

Hi titusborn, thanks for your interest! Could you explain what would be your use case? At the moment we are not working on building additional events yet, but we can always work on adding new ones in the future.

We need to know how many people are watching when live streaming.

Hi. I have a little concern about your webhook method and the params (data). I’m integrating the webhook for 2 events(“live-stream.broadcast.started”, “live-stream.broadcast.ended”). So which method are you using to send the data through webhook to my API ? I tried with post and get but none of them work.

Dai

Hi Dai,

I have 4 apps in production:

https://webhook.a.video
https://bumper.a.video
https://upload.a.video/webhook/
and
https://watch.a.video/broadcast
(github links are on the pages above)

They all use webhooks to see if a video has been encoded, or if a livestream has started streaming. All use a listener for a POST to receive the webhook response.

this is what the listener looks like in NodeJS:

app.post("/receive_webhook", function (request, response) {
	console.log("new video event from api.video");

	let body =request.body;
	console.log((body));
	let type = body.type;
	let emittedAt = body.emittedAt;
	let webhookResponse="";
	let liveStreamId = "";
	let liveStreamStatus = false;
	//we're only getting video.encoding.quality.completed right now.. but let's be careful in case the webhook changes

	if (type =="video.encoding.quality.completed"){
	  let videoId = body.videoId;
	  let encoding = body.encoding;
	  let quality = body.quality;
	  liveStreamId = body.liveStreamId;
	  webhookResponse = {"event":type, 
	  					"emittedAt": emittedAt, 
						"videoId":videoId,
						"encoding":encoding,
						"quality": quality
						}
	  
	} 
	webhooks.push(webhookResponse);
	response.sendStatus(200);  
  });

The webhooks fire within milliseconds.
If you are having issues, can you tell me which account and which webhook is having issues?

Thanks,
Doug

Hi Doug.
I tried the new 2 webhook events (“live-stream.broadcast.started”, “live-stream.broadcast.ended”) with this social account “dung.do@dirox.net” on sandbox mode. I have already tried the post method to receive webhook from our API but it’s not working. Can you check the statuses of those 2 webhooks on the account i mentioned above?

Thanks,
Nhut

Hi team,

We are getting 405 method not allowed responses from your server.

Is your Dev server set up to receive POST calls from the internet? I know sometimes that Dev servers are locked down inside an intranet.

Doug

Hi Doug,
First I tried with POST method on our server and it didn’t work so I changed to GET method and received same result. I just changed it to POST again . Can you try it again ? The test case in our side is to create a new live stream or end it to receive the webhook signal but it didn’t seem to work.

Thanks,
Nhut

@nhut.vo & @tim.hervet1

You are talking with us in our support channel as well - so we should be able to get this sorted. The webhooks POST to your server. Since the request to your server is a post, the GET will fail - perhaps that is the 405 error we see on our back end.

We cannot send new webhooks to you - they are automatically fired when you start or end a livestream (assuming that is what your subscribed to).

feel free to reply here - or in your support ticket.