Live for Developers

Makhloufi Alexandre -

As Dailymotion provides an open API, our partners can easily manage their live content by using this API. Thus anyone can create applications by using our services and thus take profit of our infrastructure. Here are some common actions that can be achieved by using our API to manage your live streams:

 

Create a live:

Once you are registered as an official partner, you can easily set up a live by using the API. A live is a video with the three following parameters:

  • mode = live
  • publish = true
  • channel = one of the available channels on Dailymotion (art, kids, video games, etc...)

The following call is used to create a live:

```
https://api.dailymotion.com/me/videos?channel=TV&mode=live&published=1&title=Test+1&access_token=<ACCESS_TOKEN>
``` 

Then you can edit your live by using the following call:

```
https://api.dailymotion.com/video/x1uzdms?private=1&access_token=

```

You can find more information on how to manipulate videos through our API at this address:

http://www.dailymotion.com/doc/api/obj-video.html

 

Get your publish URL and your stream key:

> Required scope: manage_videos

To publish your live stream on our platform, you have to provide two elements to your encoding software which are:

  • The publication URL
  • A unique stream key, used to identify you on our platform

You can get those parameters by using the following call:

```

https://api.dailymotion.com/video/?fields=live_publish_url&access_token=

```

You will obtain something like:

```
{'video_id': 'xxo9sf','live_publish_url': 'rtmp://publish.dailymotion.com/publish-dm/xxo9sf?auth=76p3_33ada1f0abc37afaa28ab7a55adeec81859e2470'}
```

Launch an ad break:

During a live a broadcaster can launch ad-break every 35 seconds. When an ad-break is launched all the viewers of the live will receive a commercial break of 35s on their player.

When a live is created, the ad-break feature is enabled by default. To disable it or re-enable it, the field live_ad_break has to be set up to false or true in the video edit (see create video section).

An ad-break launch is done using the edit a video post. We use the same field, live_ad_break, as the one to enable/disable the possibility to have ad-breaks. The required fields are:

  • video_id = Your video id
  • live_ad_break = 1

```

https://api.dailymotion.com/video/x1uzdms?live_ad_break=1&access_token=<ACCESS_TOKEN>

```

You can find some more documentation about the Dailymotion Graph API at this address: 

http://www.dailymotion.com/doc/api/getting-started.html

 

Have more questions? Submit a request

Comments

Powered by Zendesk