Each Account on Icareus Suite has its own URL for on-demand player. It can be constructed as follows:
https://suite.icareus.com/web/org_name/player/vod?assetId=SOME_NUMBER
org_name: Name of your organisation. Name of organisation is shown in url in address bar as the word followed by 'group' string in admin site.
assetId: Id of the uploaded video file. Can be obtained by using 'Assets' menu item on the left.
The On-demand video player supports the following Settings/configuration that can be passed to the player using URL query parameters.
Table: Supported Query Parameters
| Name | Value | Requirement | Info |
|---|---|---|---|
| assetId | number | Mandatory | ID of the uploaded video file |
| gdoupItemIds | common separated numbers | Optional | Separated by commas(to be used if slider is active to show slides from different groups) |
This library allows a page with video player to register current device with unique ID, fetch video URLs for the selected asset to play on the player and send video usage statistics to the server.
The library is available at the Icareus Suite server under the path /lib/js/v2/players/vod.js. Note, that VOD library uses JQuery library and if it is not available on the page, it is automatically embedded from the official JQuery site.
At the beginning the device where the page is opened is automatically registered at the Icareus Suite server with the unique ID. It is stored as the browser cookie and will persist for one year. Thus all requests from the same device will hold the same device ID used for video usage analyses.
If callback for the player setup function is provided, for the given asset ID the VOD library gets the source video URLs from the Icareus Suite server, stores them and calls the player setup function.
Also VOD library updates the player, so that it would report video usage statistics to the server.
Before loading, VOD library must be configured using the JSON object with the name '_icareus'. It holds the required parameters and is used to keep data received from the server.
Parameters:
| Name | Value | Example | Requirement | Info |
|---|---|---|---|---|
| companyId | number | 10154 | Mandatory | The company ID where organization is - given |
| groupId | number | 241825 | Mandatory | The group ID where organization is - given |
| organizationId | number | 241824 | Mandatory | The organization ID where video assets are - given |
| playerId | string | 'onDemandPlayer' | Mandatory | The ID of the player on the page |
| playerSetup | string | 'startOnDemandPlayer' | Optional | If given, this function will be called when video URLs for the given asset are received from the server. They will become available as 'sources' parameter of the '_icareus' object. That can be used, for example, to setup and start video player. If not provided, it is assumed that video player knows how to fetch video URLs for the given asset. |
| host | string | 'http://192.168.1.146/' | Optional | If given, this host will be used as the Icareus Suite server. If not provided, it is assumed that the page is located on the Icareus Suite server. |
| itemId | number | 248920 | Optional | If given, it holds the asset ID to play on the video player. If not provided, it is assumed that asset ID is given as the 'assetId' or 'itemId' parameter for the page URL. |
Example:
var _icareus = {};_icareus['companyId']=10154;_icareus['groupId']=241825;_icareus['organizationId']=241824;_icareus['playerId']='onDemandPlayer';_icareus['playerSetup']='startOnDemandPlayer';_icareus['itemId']=248920;// optional_icareus['playerAutostart']=true; //If want to autostart player_icareus['userId']='10156'; //To pass userId for access validation of content_icareus['token']=0348de1dc0cb8fd8167db7e97707301d5a2d03886c; //To use version 03 of API (userId should be present with this) |
To embed the VOD library just place the provided code on the page and define the correct location of the library.
(function() { var vod= document.createElement('script'); vod.type = 'text/javascript'; vod.async = true; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(vod, s);})(); |
This example shows how VOD library can be used together with JWPlayer. It is assumed, that asset ID is provided as a parameter to the page URL and the page is not located on the Icareus Suite server.
<html> <head> <script type="text/javascript" src="/jwplayer/jwplayer.js"></script> <script type="text/javascript"> var _icareus = {}; _icareus['companyId']=10154; _icareus['groupId']=241825; _icareus['organizationId']=241824; _icareus['playerId']='onDemandPlayer'; _icareus['playerSetup']='startOnDemandPlayer'; (function() { var vod= document.createElement('script'); vod.type = 'text/javascript'; vod.async = true; vod.src = _icareus['host']+'/lib/js/v1/players/vod.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(vod, s); })(); </script> <script type="text/javascript"> function startOnDemandPlayer() { var player = jwplayer("onDemandPlayer").setup({ flashplayer: "/jwplayer/jwplayer.flash.swf", html5player: "/jwplayer/jwplayer.html5.js", sources: _icareus["sources"], primary: "html5", width: 640, height: 360, mute: "false", stretching: "fill" }); if (typeof player.on !== "undefined") { player.on("ready",function() { this.play(); }); } else if (typeof player.onReady !== "undefined") { player.onReady(function() { this.play(); }); } } </script> </head> <body> <div id="onDemandPlayer"/> </body></html> |