Create a clip after a Live Event ends
After Live Event has ended, use the Platform Management API v2 to create a clip from the recorded event. The created clip is a new media resource with a new media ID.
As an alternative to using the API, you can create a clip from a Live Event from your JW Player dashboard.
Implementation
- Check the status of the master asset.
GET https://api.jwplayer.com/v2/sites/{site_id}/channels/{channel_id}/events/{event_id}.
The API call returns a response that includes the master_access.status: available
.
{
...
"master_access": {
"expiration": "2021-01-29T17:50:48+00:00",
"status": "available"
},
"master_expiration": "2021-01-29T17:50:48+00:00",
...
"type": "event"
}
- If the previous call returns
master_access.status: unavailable
, request that the master asset be made available. Otherwise, skip to step 3.
PUT https://api.jwplayer.com/v2/sites/{site_id}/channels/{channel_id}/events/{event_id}/request_master
This
PUT
call only has to be made once every 24 hours. After sending this request, periodically check the status of the master until it becomes available.You can configure a "Media Available" webhook or a "Media Available" Zap to notify you when the recording is ready to be streamed or downloaded.
- Make an API call to create a media resource from the master asset.
PUT https://api.jwplayer.com/v2/sites/{site_id}/channels/{channel_id}/events/{event_id}/clip/?trim_in_point=03:02:45.106&trim_out_point=03:02:46.204
The API call returns the media_id
for the new media resource.
{
"media_id": "DBEvlBLr1"
}
Share the media resource
Now that you have created the media resource, you can share it with your viewers.
You can add the media resource to the playlist object of an embedded player.
jwplayer("myElement").setup({
playlist: "http://cdn.jwplayer.com/v2/media/1234abcD"
});
You can also access the renditions created for the media resource to share on social media. Make a GET https://cdn.jwplayer.com/v2/media/{media_id}
call. The API call will return a JSON response that includes URLs to each rendition in a playlist[].sources
object.
{
...
"playlist": [{
...
"sources": [{
"file": "https://cdn.jwplayer.com/manifests/1234abcD.m3u8",
"type": "application/vnd.apple.mpegurl"
}, {
"file": "https://cdn.jwplayer.com/videos/1234abcD-JVRgUcsw.mp4",
"type": "video/mp4",
"height": 200,
"width": 320,
"label": "180p",
"filesize": 1855010
}, {
"file": "https://cdn.jwplayer.com/videos/1234abcD-poiy5QyW.mp4",
"type": "video/mp4",
"height": 300,
"width": 480,
"label": "270p",
"filesize": 2500007
}, {
"file": "https://cdn.jwplayer.com/videos/1234abcD-VhzQqByf.mp4",
"type": "video/mp4",
"height": 450,
"width": 720,
"label": "406p",
"filesize": 3455095
}, {
"file": "https://cdn.jwplayer.com/videos/1234abcD-8lnls3nv.m4a",
"type": "audio/mp4",
"label": "AAC Audio",
"filesize": 1087399
}]
}]
}