C# Class Youbora.Analytics.Providers.API.YouboraApi

显示文件 Open project: NicePeopleAtWork/NicePlayers

Public Methods

Method Description
Buffer ( double time, long duration, string code, Action complete, Action error ) : void

Detects when the end user is experiencing buffering issues

CreateProperties ( string fileName ) : string

Create Properties Json.

CreateProperties ( string title, string fileName, long duration ) : string

Create Properties Json.

CreateProperties ( string fileName, string title, string genre, string language, string year, string cast, string director, string owner, long duration, Parental parental, double price, string rating, AudioType audioType, double audioChannels, string contentId, TransactionType transactionType, Common.Quality quality, ContentType contentType, string manufacturer, string deviceType, string deviceYear, string firmware ) : string

Create Properties Json.

Error ( string errorCode, string code, string msg, string resource, string system, bool live, string properties, string user, string referer, double bitrate, int pingTime, string pluginVersion, long duration, string extraParams, Action complete ) : void

Reports a player error.

GetData ( string system, string pluginVersion ) : Models.Data.Data

Get Youbora Data

GetData ( string system, string pluginVersion, Action complete ) : void

Get Youbora Data

GetSmartswitch ( string systemCode, string originCode, string resource, double niceNva, double niceNvb, string secretKey, Action complete ) : void

Returns a JSON object with an array of different resource URLs sorted by the quality of experience they offer.

GetSmartswitch ( string systemCode, string originCode, string resource, double niceNva, double niceNvb, string secretKey, Action complete, Action error ) : void

Returns a JSON object with an array of different resource URLs sorted by the quality of experience they offer.

Join ( string time, double joinTime, string code, long mediaDuration, Action complete, Action error ) : void

Determines the elapsed amount of time since the end user clicks/touches the player's play button until the media starts to be played

ParseSmartswitch ( string json ) : Models.Smartswitch.Smartswitch

Return a Smartswitch object from a Json file.

Pause ( string code, Action complete, Action error ) : void

Informs when the user has paused the playback

Pin ( string code, string pingTime, double bitrate, double time, double diffTime, string nodeHost, string nodeType, Action complete, Action error ) : void

Informs when the user has restarted the playback

Pin ( string code, string pingTime, double bitrate, double time, string nodeHost, string nodeType, Action complete, Action error ) : void

Informs when the user has restarted the playback

Resume ( string code, Action complete, Action error ) : void

Informs when the user has paused the playback

Seek ( double time, long duration, string code, Action complete, Action error ) : void

Detects the end user change the curren position of the video.

Seek ( float time, int duration, string code, Action complete ) : void

Detects the end user change the curren position of the video.

Start ( string system, string user, string pluginVersion, string code, string resource, bool live, string properties, string referer, int pingTime, long duration, double bitrate, string extraparams, Action complete, Action error ) : void

Start event information

Stop ( string code, Action complete, Action error ) : void

Informs when the current playback has ended

Stop ( string code, int diffTime, Action complete, Action error ) : void

Informs when the current playback has ended

Method Details

Buffer() public static method

Detects when the end user is experiencing buffering issues
public static Buffer ( double time, long duration, string code, Action complete, Action error ) : void
time double Video playhead in seconds. If this value is 0, no data is saved in Nice Analytics backend
duration long Buffering duration in milliseconds. This is the time difference between: buffering end time - buffering start time
code string View code retrieved from the data call
complete Action Complete Action
error Action Error Action
return void

CreateProperties() public static method

Create Properties Json.
public static CreateProperties ( string fileName ) : string
fileName string File name of the current media content
return string

CreateProperties() public static method

Create Properties Json.
public static CreateProperties ( string title, string fileName, long duration ) : string
title string Media title
fileName string File name of the current media content
duration long Expected video duration in seconds (Should be 0 if Live content) in Length column of Youbora. (Make sure /// that if a duration has been set manually, it overwrites the one get from the player)
return string

CreateProperties() public static method

Create Properties Json.
public static CreateProperties ( string fileName, string title, string genre, string language, string year, string cast, string director, string owner, long duration, Parental parental, double price, string rating, AudioType audioType, double audioChannels, string contentId, TransactionType transactionType, Common.Quality quality, ContentType contentType, string manufacturer, string deviceType, string deviceYear, string firmware ) : string
fileName string File name of the current media content
title string Media title
genre string Media genre
language string Media language
year string Media year
cast string Media cast. Separate each name with commas
director string Media director or directors. Separate each value with commas
owner string Media's content owner
duration long Length of the media in seconds
parental Parental Recommended viewing age (All,+13,+18,Adult)
price double Purchase price on the website
rating string Average value on your user's perception on the content quality, performance...
audioType AudioType Media file type of audio (Mono, Stereo, Dolby,…)
audioChannels double Number of media file channels (1, 5.1, …)
contentId string Internal ID for the media
transactionType TransactionType Rent: Media for rental Subscription: Media which has been acquired as part of a subscription EST (Electronic Sell Through): Media purchased Free: Media which has no economical transaction
quality Common.Quality HD or SD
contentType ContentType Trailer, Episode, Movie
manufacturer string Manufacturer of the device
deviceType string TV, Blu-Ray, Set-Top Box
deviceYear string Fabrication year
firmware string Firmware version
return string

Error() public static method

Reports a player error.
public static Error ( string errorCode, string code, string msg, string resource, string system, bool live, string properties, string user, string referer, double bitrate, int pingTime, string pluginVersion, long duration, string extraParams, Action complete ) : void
errorCode string Player's error numerical code
code string View code retrieved from the data call
msg string Player’s error message.
resource string Vídeo resource URL
system string Your Nice PeopleAtWork account code that indicates Youbora which customer account you are sending the data to. This parameter will be provided by NicePeopleAtWork, if you don't have it yet, please contact your Customer Engineer or Support Agent
live bool Boolean variable to identify if the video is a live (true) or an on demand (false) stream. Many of our plugins have a method integrated that lets the customer, when integrating the plugin, use a method to set this property
properties string JSON media properties (the same ones described in the start call)
user string User identifier. If the user is unknown, send a blank parameter or with a default username
referer string Browser's URL where the player is being loaded (window.location)
bitrate double bitrate (bps)
pingTime int pt tag from data response
pluginVersion string The version of the plugin in the x.x.x_pluginCode format. This parameter lets you to have a version control of new deployed plugins and see which users are using an older version (cached in the system), so you can force them to clean their cache and download the new version
duration long
extraParams string Custom Data feature
complete Action Complete Action
return void

GetData() public static method

Get Youbora Data
public static GetData ( string system, string pluginVersion ) : Models.Data.Data
system string Your Nice PeopleAtWork account code that indicates Youbora Analytics /// which customer account you are sending the data to. This parameter will be provided by /// NicePeopleAtWork, if you don't have it yet, please contact your Customer Engineer or Support /// Agent
pluginVersion string The version of the plugin in the format described below this table. /// This parameter lets you to have a version control of new deployed plugins and see which /// users are using an older version (cached in the system), so you can force them to clean /// their cache and download the new version
return Models.Data.Data

GetData() public static method

Get Youbora Data
public static GetData ( string system, string pluginVersion, Action complete ) : void
system string Your Nice PeopleAtWork account code that indicates Youbora Analytics /// which customer account you are sending the data to. This parameter will be provided by /// NicePeopleAtWork, if you don't have it yet, please contact your Customer Engineer or Support /// Agent
pluginVersion string The version of the plugin in the format described below this table. /// This parameter lets you to have a version control of new deployed plugins and see which /// users are using an older version (cached in the system), so you can force them to clean /// their cache and download the new version
complete Action Complete Action
return void

GetSmartswitch() public static method

Returns a JSON object with an array of different resource URLs sorted by the quality of experience they offer.
public static GetSmartswitch ( string systemCode, string originCode, string resource, double niceNva, double niceNvb, string secretKey, Action complete ) : void
systemCode string Your Nice PeopleAtWork account code that indicates Youbora Smartswitch which customer account rules are going to be applied. This parameter will be provided by NicePeopleAtWork, if you don't have it yet, please contact your Customer Engineer or Support Agent.
originCode string Origin code configured in Smartswitch's Account Settings
resource string Urlencoded resource path where the file can be found inside the configured bucket
niceNva double "not valid after" parameter. It defines the timestamp (in milliseconds) after the generated URL won't be valid. This is the current UTC time + the amount of time you want, in milliseconds
niceNvb double "not valid before" parameter. It defines the timestamp (in milliseconds) that it will take that URL to be valid and accessible. This is the current UTC time + the amount of time you want, in milliseconds.
secretKey string Secret key
complete Action Complete Action
return void

GetSmartswitch() public static method

Returns a JSON object with an array of different resource URLs sorted by the quality of experience they offer.
public static GetSmartswitch ( string systemCode, string originCode, string resource, double niceNva, double niceNvb, string secretKey, Action complete, Action error ) : void
systemCode string Your Nice PeopleAtWork account code that indicates Youbora Smartswitch which customer account rules are going to be applied. This parameter will be provided by NicePeopleAtWork, if you don't have it yet, please contact your Customer Engineer or Support Agent.
originCode string Origin code configured in Smartswitch's Account Settings
resource string Urlencoded resource path where the file can be found inside the configured bucket
niceNva double "not valid after" parameter. It defines the timestamp (in milliseconds) after the generated URL won't be valid. This is the current UTC time + the amount of time you want, in milliseconds
niceNvb double "not valid before" parameter. It defines the timestamp (in milliseconds) that it will take that URL to be valid and accessible. This is the current UTC time + the amount of time you want, in milliseconds.
secretKey string Is a secret key shared by NicePeopleAtWork and the customer to authenticate all the calls against the Smartswitch
complete Action Complete Action
error Action Error Action
return void

Join() public static method

Determines the elapsed amount of time since the end user clicks/touches the player's play button until the media starts to be played
public static Join ( string time, double joinTime, string code, long mediaDuration, Action complete, Action error ) : void
time string Time difference (in milliseconds) between the player goes from the start event until it finishes buffering the required amount of video bytes to start the playback. Or the amount of time it takes to start the playback since the user wants to watch it
joinTime double Current instant of the video (video playhead) where the joinTime occurs in seconds(usually 0)
code string View code retrieved from the data call
mediaDuration long Length of the media in seconds
complete Action Complete Action
error Action Error Action
return void

ParseSmartswitch() public static method

Return a Smartswitch object from a Json file.
public static ParseSmartswitch ( string json ) : Models.Smartswitch.Smartswitch
json string Json
return Models.Smartswitch.Smartswitch

Pause() public static method

Informs when the user has paused the playback
public static Pause ( string code, Action complete, Action error ) : void
code string View code retrieved from the data call
complete Action Complete Action
error Action Error Action
return void

Pin() public static method

Informs when the user has restarted the playback
public static Pin ( string code, string pingTime, double bitrate, double time, double diffTime, string nodeHost, string nodeType, Action complete, Action error ) : void
code string View code retrieved from the data call
pingTime string Elapsed ping time in seconds from the previous ping
bitrate double Current bitrate in bps (bits per second)
time double Video's current time in seconds.
diffTime double Elapsed ping time in miliseconds from the previous ping
nodeHost string
nodeType string
complete Action Complete Action
error Action Error Action
return void

Pin() public static method

Informs when the user has restarted the playback
public static Pin ( string code, string pingTime, double bitrate, double time, string nodeHost, string nodeType, Action complete, Action error ) : void
code string View code retrieved from the data call
pingTime string Elapsed ping time in seconds from the previous ping
bitrate double Current bitrate in bps (bits per second)
time double Video's current time in seconds.
nodeHost string
nodeType string
complete Action Complete Action
error Action Error Action
return void

Resume() public static method

Informs when the user has paused the playback
public static Resume ( string code, Action complete, Action error ) : void
code string View code retrieved from the data call
complete Action Complete Action
error Action Error Action
return void

Seek() public static method

Detects the end user change the curren position of the video.
public static Seek ( double time, long duration, string code, Action complete, Action error ) : void
time double Video playhead in seconds. If this is 0, no data is saved in Nice Analytics backend
duration long Seeking duration in miliseconds. This is the time difference between seek end time - seek start time
code string View code retrieved from the data call
complete Action Complete Action
error Action Error Action
return void

Seek() public static method

Detects the end user change the curren position of the video.
public static Seek ( float time, int duration, string code, Action complete ) : void
time float Video playhead in seconds. If this is 0, no data is saved in Nice Analytics backend
duration int Seeking duration in miliseconds. This is the time difference between seek end time - seek start time
code string View code retrieved from the data call
complete Action Complete Action
return void

Start() public static method

Start event information
public static Start ( string system, string user, string pluginVersion, string code, string resource, bool live, string properties, string referer, int pingTime, long duration, double bitrate, string extraparams, Action complete, Action error ) : void
system string Your Nice PeopleAtWork account code that indicates Youbora Analytics which customer account you are sending the data to. This parameter will be provided by NicePeopleAtWork, if you don't have it yet, please contact your Customer Engineer or Support Agent
user string User identifier. If the user is unknown, send the parameter blank or with a default username
pluginVersion string
code string View code retrieved from the data call
resource string
live bool Boolean variable to identify if the video is a live (true) or an on demand (false) stream. Many of our plugins have a method integrated that lets the customer, when integrating the plugin, use a method to set this property
properties string JSON media properties (see them defined below in a sub-section)
referer string Browser's URL where the player is being loaded (or window.location for Smart TV applications). This field can be empty but must be declared.
pingTime int The version of the plugin in the x.x.x_pluginCode format. This parameter lets you to have a version control of new deployed plugins and see which users are using an older version (cached in the system), so you can force them to clean their cache and download the new version
duration long Video length in seconds
bitrate double Video bitrate
extraparams string
complete Action Complete Action
error Action Error Action
return void

Stop() public static method

Informs when the current playback has ended
public static Stop ( string code, Action complete, Action error ) : void
code string View code retrieved from the data call
complete Action Complete Action
error Action Error Action
return void

Stop() public static method

Informs when the current playback has ended
public static Stop ( string code, int diffTime, Action complete, Action error ) : void
code string View code retrieved from the data call
diffTime int Should be more or less 5000ms if pingTime is 5s by default
complete Action Complete Action
error Action Error Action
return void