Live Streaming API

The Live Streaming API can be used to create, read, update and delete live streams.

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:POST
URL: 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):
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" : ""
        }
   ]
}
Notes:
Example Call #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"
        }
   ]
}
Expected Response #1:
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:GET
URL: 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):
GET /api/users/{username}/live/{liveStreamName} HTTP/1.1
Accept: application/json
Example Call #1:
GET /api/users/testuser/live/liveTest HTTP/1.1
Accept: application/json
Expected Response #1:
HTTP/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
        }
    ]
}
HTTP Operation:GET
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:
GET /api/users/testuser/live HTTP /1.1
Accept: text/plain, text/html
Expected Response #2:
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:PUT
URL: 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):
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" : ""
        }
   ]
}
Example Call #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"
   ]
}
Expected Response #1:
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: DELETE
URL: 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):
DELETE /api/users/{username}/live/{liveStreamName} HTTP/1.1
Example Call #1:
DELETE /api/users/test/live/liveTest HTTP/1.1
Expected Response #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