The Live Streaming API can be used to create, read, update and delete live stream endpoints. You can livestream your events using compatible live stream software such as Flash Media Live Encoder. Your livestream is distributed onto our global CDN for streaming to end-users.
Create (register) live stream
HTTP Operation: POSTURL: POST http://www.metacdn.com/api/users/{username}/live
Auth: HTTP digest authentication
"Content-Type" header: application/json
Expected HTTP response: HTTP/1.1 201 Created
Expected Format (mandatory, optional):
Notes:POST /api/users/{username}/live HTTP/1.1 Content-Type: application/json { "name": "", "title": "", "description": "", "password": "", "mobileStream": true/false, "hlsKeyframeInterval": "", "hlsSegmentSize": "" "videoEnabled": true/false, "brandingTemplateName": "", "splashScreenUrl": "", "noStreamingWarningMsg": "", "audioEnabled": true/false, "audioFormat": "", "audioBitrate": "", "streams": [{ "bitRate": "", "width": "", "height": "" }, ..., { "bitRate": "", "width": "", "height": "" }] }
- "name" is the alphanumeric name you wish to give your stream. It cannot contain any spaces and only lowercase letters are allowed.
- "title" will be used in the preview page. The maximum length allowed for the title field is 100 characters.
- "password" will be set to allow only authorised user to publish the live stream.
- "splashScreenUrl" is the URL of an image which gets displayed in the media player before the live streaming starts playing back.
- "noStreamingWarningMsg" is a message to appear on the player when your event is not streaming.
- "mobileStream" will create an HLS stream for mobile users. Note that the mobile device either needs to support Flash or be able to play .m3u8 streams in the installed HTML5 browser-implementation. At this stage, the latter is only possible on iDevices (Safari).
- "hlsKeyframeInterval" defines the time interval, in seconds, between key frames in the encoded media. Default value is 2. This only required if mobileStream is set to true.
- "hlsSegmentSize" defines the size of the segments that will be generated for the event. Default value is 10. This only required if mobileStream is set to true.
- "audioEnabled" specifies whether there is audio in the live stream or not.
- "videoEnabled" specifies whether the live stream contains a video stream. For example, this would be set to false if you would like to broadcast audio-only such as a radio station.
- "audioFormat" can either be MP3 or AAC. MetaCDN recommends using AAC, however, AAC is not freely available on Windows.
- "audioBitrate" can be one of the following values: 64, 96, 128 or 160 . MetaCDN recommends using 128 which corresponds to 128kbps.
- "streams" is a list of streams you will sending to MetaCDN. You need at least one. Depending on your live stream subscription, there is an upper limit.
- "bitRate" is the Bit Rate of the video you will be streaming to MetaCDN with - it is displayed on your streaming software.
- "width" is the width of the video you will be streaming to MetaCDN with - it is displayed on your streaming software.
- "height" is the height of the video you will be streaming to MetaCDN with - it is displayed on your streaming software.
- You will get an error if you have reached your plan's allocated quota.
Expected Response #1:POST /api/users/testuser/live HTTP/1.1 Content-Type: application/json { "name": "livetest", "title": "MetaCDN Live Streaming", "description": "This is a test live stream of MetaCDN", "password": "livePassowrd", "mobileStream": true, "hlsKeyframeInterval": "2", "hlsSegmentSize": "10", "videoEnabled": true, "brandingTemplateName": "myTemplate", "splashScreenUrl": "http://www.metacdn.com/img/splash/splash.png", "noStreamingWarningMsg": "Live stream is not broadcasting at the moment.", "audioEnabled": true, "audioFormat": "MP3", "audioBitrate": "128", "streams": [{ "bitRate": "150", "width": "176", "height": "144" }, { "bitRate": "300", "width": "320", "height": "240" }, { "bitRate": "650", "width": "480", "height": "360" }] }
HTTP/1.1 201 Created Content-Type: application/json; charset=UTF-8 Accept-Ranges: bytes Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept Date: Mon, 12 Sep 2011 07:00:28 GMT Server: Google Frontend Cache-Control: private, x-gzip-ok="" Connection: close Live stream created
Get live stream
HTTP Operation: GETURL: GET http://www.metacdn.com/api/users/{username}/live/{liveStreamName}
Auth: HTTP digest authentication
"Accept" header: application/json
Expected HTTP response: HTTP/1.1 200 OK
Expected Format (mandatory, optional):
Example Call #1:GET /api/users/{username}/live/{liveStreamName} HTTP/1.1 Accept: application/json
Expected Response #1:GET /api/users/testuser/live/liveTest HTTP/1.1 Accept: application/json
HTTP Operation:GETHTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 Accept-Ranges: bytes Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept Date: Mon, 12 Sep 2011 07:05:36 GMT Server: Google Frontend Cache-Control: private, x-gzip-ok="" Connection: close { "name": "liveTest", "description": "This is a test live stream of MetaCDN", "password": "livePassowrd", "title": "MetaCDN Live Streaming", "mobileStream": false, "videoEnabled": true, "brandingTemplateName": "myTemplate", "splashScreenUrl": "http://www.metacdn.com/img/splash/splash.png", "noStreamingWarningMsg": "Live stream is not broadcasting at the moment.", "createdTime": "22 Nov 2012 03:13:36 GMT", "audioEnabled": true, "audioFormat": "MP3", "audioBitrate": "128", "metaCdnUrl": "http://localhost:8888/r/l/vduoemv/liveTest", "liveStatus": "PENDING" "streams": [{ "width": "176", "height": "144" "bitRate": "150", "enabled": true }, { "bitRate": "300", "width": "320", "height": "240", "enabled": true }, { "bitRate": "650", "width": "480", "height": "360", "enabled": true }] }
URL: GET http://api.metacdn.com/api/users/{username}/live
Auth: HTTP digest authentication
"Accept" header: text/plain, text/html
Expected HTTP response: HTTP/1.1 200 OK
Expected Format (mandatory, optional):
GET /api/users/{username}/live HTTP /1.1 Accept: text/plain, text/html
Example Call #2:
Expected Response #2:GET /api/users/testuser/live HTTP /1.1 Accept: text/plain, text/html
HTTP/1.1 200 OK Content-Type: text/html; charset=ISO-8859-1 Accept-Ranges: bytes Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept Date: Mon, 12 Sep 2011 07:08:36 GMT Server: Google Frontend Cache-Control: private, x-gzip-ok="" Transfer-Encoding: chunked { "liveStreams": [{ "name": "test1", "description": "testDescription", "password": "testPass", "title": "testTitle", "mobileStream": false, "videoEnabled": true, "brandingTemplateName": "Default", "audioEnabled": true, "audioFormat": "AAC", "audioBitrate": "128", "metaCdnUrl": "http://localhost: 8888/r/l/vduoemv/test1", "streams": [{"width": 100,"height": 100,"enabled": true,"bitRate": 100}], "liveStatus": "PENDING" }, { "name": "liveTest", "description": "This is a test live streaming of MetaCDN", "password": "livePassowrd", "title": "MetaCDN Live Streaming", "mobileStream": true, "brandingTemplateName": "Default", "audioFormat": "MP3", "audioBitrate": "128", "metaCdnUrl": "http: //localhost: 8888/r/l/vduoemv/liveTest", "streams": [ {"width": 176,"height": 144,"enabled": true,"bitRate": 150}, {"width": "320","height": "240","enabled": true,"bitRate": "300"}, {"width": "480","height": "360","enabled": true,"bitRate": "650"} ], "liveStatus": "PENDING" }] }
Update live stream
HTTP Operation: PUTURL: PUT http://www.metacdn.com/api/users/{username}/live/{liveStreamName}
Auth: HTTP digest authentication (User)
"Content-Type" header: application/json
Expected HTTP response: HTTP/1.1 202 Accepted
Expected Format (mandatory, optional):
Example Call #1:PUT /api/users/{username}/live/{liveStreamName} HTTP/1.1 Content-Type: application/json { "description": "updatedDescription", "mobileStream": true, "hlsKeyframeInterval": "2", "hlsSegmentSize": "10", "videoEnabled": true, "brandingTemplateName": "myAnotherTemplate", "splashScreenUrl": "http://www.metacdn.com/img/splash/splash.png", "noStreamingWarningMsg": "Live stream is not broadcasting at the moment.", "audioEnabled": true", "audioFormat": "AAC", "audioBitrate": "96", "streams": [{ "bitRate": "", "width": "", "height": "" }, ..., { "bitRate": "", "width": "", "height": "" }] }
Expected Response #1:PUT /api/users/test/live/testLive HTTP/1.1 Accept: application/json { "description": "Updated Description", "mobileStream": true, "hlsKeyframeInterval": "2", "hlsSegmentSize": "10", "password": "newpass", "brandingTemplateName": "newTemplate", "splashScreenUrl": "http://www.metacdn.com/img/splash/splash.png", "noStreamingWarningMsg": "Live stream is not broadcasting at the moment.", "audioEnabled": false, "audioFormat": "MP3", "streams": [ "bitRate": "450", "width": "480", "height": "360" ] }
HTTP/1.1 202 Accepted Accept-Ranges: bytes Vary: Accept-Charset, Accept-Encoding, Accept-Language. Accept Date: Mon, 12 Sep 2011 07:11:20 GMT Content-Type: text/html Server: Google Frontend Live stream updated
Delete live stream
HTTP Operation: DELETEURL: DELETE http://www.metacdn.com/api/users/{username}/live/{liveStreamName}
Auth: HTTP digest authentication
Expected HTTP response: HTTP/1.1 202 Updated
Expected Format (mandatory, optional):
Example Call #1:DELETE /api/users/{username}/live/{liveStreamName} HTTP/1.1
Expected Response #1:DELETE /api/users/test/live/liveTest HTTP/1.1
HTTP/1.1 202 Accepted Content-Type: text/plain; charset=ISO-8859-1 Accept-Ranges: bytes Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept Date: Mon, 12 Sep 2011 07:11:20 GMT Server: Google Frontend Cache-Control: private, x-gzip-ok="" Transfer-Encoding: chunked Stream is scheduled for deletion