The method CreateSession has two functions: you can use it for protection of the content delivery, or if you want to create your own player by using Flash or HTML5
By calling this method you ask to the server to generate an authentication password that is valid for 24 hours.
<?xml version="1.0" encoding="utf-8" ?>
"utcStartDate": "Start date",
"utcEndDate": "End date"
|token||Specify your MainStreaming API KEY|
|contentId||Specify the contentID of the content you want to delivery.|
|userAgent||UserAgent of the client that is requesting the content (you have to specify it, for a true statistic tracking)|
|userHostAddress||IP Address of the client that is requesting the content (you have to specify it, for a true statistic tracking)|
<SessionStruct xmlns="http://schemas.datacontract.org/2004/07/Mainsoft.Streaming.Sdk._13" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
The response give to you four values:
SessionId is the value to be used to protect the content. With this value you can embed your content using this URL:
In this way the client can watch the content through a session code, valid for a limited time. All the session have a duration of 24 hours. In the next version of the API will be available the possibilty to customize the duration of the session.
The IFRAME embedding procedure is the same and all parameters are valid.
With cupertinoHLSUrl, rtmpSmil and sanJoseHTTPUrl you can create a custom player in Flash or HTML5.
Session ID can be used as a access password and is secure enough because limits the session to a 24 hours duration. It's important to not distribute the ContentID because the creation of the session is not more valid to protect your content.
The video is visible by any IP Address, even if you specify the IP Address of the user on the request parameters. The field is used only for statistic purposes. There isn't an IP blocking system because there are a lot of devices that have more than one internet connection (ethernet/wifi/3g/4g) and can appear with different IP address even after the create session request.