Module: Player

Methods


init(config)

Initializes the Player.
This method must be called before any other methods.

Parameters:
Name Type Description
config module:Player~config

The configurations for player initialization.


open(source)

Sets the media source before playback. Returns true if the player call open() successfully.

Parameters:
Name Type Description
source module:Player~sourceConfig

The media source to be opened.

See:

addEventListener(event, callback, scope)

Adds listener to listen event in voEvents.

Parameters:
Name Type Description
event voEvents

Event defined in voEvents.

callback function

Callback method when the event fires.

scope object

Context of the callback that can ensure the callback to be added properly.

See:

removeEventListener(event, callback, scope)

Removes the event listener.

Parameters:
Name Type Description
event voEvents

Event defined in voEvents.

callback function

Callback method when the event fires.

scope object

Context of the callback that can ensure the callback to be removed properly.

See:

play()

Starts playing the current audio or video.

See:

pause()

Halts (pauses) the currently playing audio or video.

See:

isPaused()

Returns true if the player has started playback but is currently paused.

Returns:

True if video element is paused. False if not paused.

Type
boolean

isEnded()

Returns true if the current playback is completed.

Returns:

True if playback is completed. False if not completed.

Type
boolean

stop(endCause)

If no parameter, stop the player without destroying the player instance. If with parameter, send stop request event to Verspective Analytics Export

Parameters:
Name Type Description
endCause strings

if with this param, send stop event to Verspective Analytics Export.

See:
Example
{
 stop();
 stop('TERMINATED_BY_USER'); //send stop event to Verspective Analytics Export
}

close()

Closes the player instance.

See:

setPosition(pos)

Sets the current position (in seconds) of the audio/video playback.

Parameters:
Name Type Description
pos number

A relative time in seconds.

See:

getPosition()

Returns the current position (in seconds) of the audio/video playback.

See:
Returns:

The current playhead time of the media.

Type
number

getDuration()

Gets the duration of current media.

Returns:

The duration of the media in seconds. Returns Infinity if the media is a live stream.

Type
number

getSeekableRange()

Gets the seekable range of the media.

Returns:

The current seekable time range of the media.

Type
module:Player~TimeRange

isLive()

Returns true if the current media is live, otherwise returns false.

Returns:

True means the playing stream is live.

Type
boolean

mute()

Mutes the player if an audio track is available.

See:

unmute()

Unmutes the player if muted.

See:

isMuted()

Returns true if the player has been muted.

See:
Returns:

True if audio is muted. False if not muted.

Type
boolean

setVolume(volume)

Sets the player volume in the range of 0.0 to 1.0.

Parameters:
Name Type Description
volume number

Volume value, the range is between [0.0, 1.0].

See:

getVolume()

Returns the player volume between 0.0 and 1.0.

See:
Returns:

Between [0.0, 1.0].

Type
number

resize(width, height)

Sets the new width & height for the ad window.

Parameters:
Name Type Description
width number

The new width of ad window in pixels.

height number

The new height of ad window in pixels.


getQualityLevels()

Returns an array of objects based on each quality level of a media item.

Returns:

An array of module:Player~qualityLevel objects based on each quality level of a media item.

Type
Array

getAudioTracks()

Returns an array of available audio tracks of current selected quality level.

Returns:

An array of module:Player~audioTrack objects of current selected quality level.

Type
Array

getSubtitleTracks()

Returns an array of available subtitle tracks of the current selected quality level.

Returns:

An array of module:Player~subtitleTrack objects of current selected quality level.

Type
Array

selectQualityLevel(id)

Selects the required quality level.

Parameters:
Name Type Description
id string

The id property of a quality level object.


selectAudioTrack(id)

Selects the required audio track.

Parameters:
Name Type Description
id string

The id property of a audio track object.


selectSubtitleTrack(id)

Selects the required subtitle track by id.

Parameters:
Name Type Description
id string

The id of property of subtitle track object.


getCurrentQualityLevel()

Returns the object of the current active quality level.

Returns:

The object of the current active quality level.

Type
module:Player~qualityLevel

getCurrentAudioTrack()

Returns the object of the current active audio track.

Returns:

The object of the current active audio track.

Type
module:Player~audioTrack

getCurrentSubtitleTrack()

Returns the object of the current active subtitle track.

Returns:

The object of the current active subtitle track.

Type
module:Player~subtitleTrack

setSubtitleStyles(subStyles)

Sets current text track styles.

Parameters:
Name Type Description
subStyles module:Player~subtitleStyles

Subtitle style configurations.


getDefaultSubtitleStyles()

Returns the default subtitle styles.

Returns:

The object of default subtitle styles.

Type
module:Player~subtitleStyles

getValidBufferDuration(type)

Gets the length of the buffer for the given media type. Valid media types are "video", "audio" and "fragmentedText". Returns NaN if the type is invalid. Note: The "fragmentedText" type only can be used for dash.

Parameters:
Name Type Description
type string

The media type of the buffer.

Returns:

The length of the buffer for the given media type in seconds or NaN.

Type
number

setAudioPlaybackSpeed(speed)

Sets the audio playback speed.
Caution: The speed setting should not be higher than normal speed (1X) that may cause a BA during the playback.

Parameters:
Name Type Description
speed float

Speed multiplier with respect to realtime playback. Default value is 1.0.


findNearestThumbnail(pos)

Returns a thumbnailInfo object. Null if there is no thumbnail available.

Parameters:
Name Type Description
pos number

The media position (in seconds) of which the thumbnail should be returned.

Returns:

A thumbnailInfo object is set by open() method. Returns null if there is no thumbnail.

Type
module:Player~thumbnailInfo

isPipSupported()

Returns true if the PIP is supported by the specific browser. (Safari or Chrome70+)

See:
Returns:

True if PIP is available. False if not supported.

Type
boolean

isInPipMode()

Returns true if the presentation is in PIP mode. (Safari or Chrome70+)

See:
Returns:

True if the presentation is in PIP mode. False if not.

Type
boolean

setPipPresentation(show)

Sets the PIP presentation mode. (Safari or Chrome70+)

Parameters:
Name Type Description
show boolean

Turn on/off the PIP mode. If no video link is playing, or pure audio link is playing, player cannot enter into PIP mode.

See:

isAirplaySupported()

Returns true if the airplay is supported by the current browser. (Safari Only)

See:
Returns:

True if airplay is available. False if not supported.

Type
boolean

showPlaybackTargetPicker()

Shows playback target picker. (Safari Only)

See:

getVersion()

Gets the current player version.

Returns:

The version of player.

Type
number

setExternalSubtitle(subtitle)

Adds a new external subtitle track.
This method should be called after the playback started.

Parameters:
Name Type Description
subtitle module:Player~externalSubtitleInfo

External subtitle settings.

See:
  • Note: The external subtitle could be set before the playback and during the playback.
    It is set as a module:Player~sourceConfigTrack object of module:Player~sourceConfig if the external subtitle is set before playback.
    It calls the API if the external subtitle is set during the playback.

getAnalyticsInfo()

Returns the analytics information.

Returns:

The analytics information.

Type
module:Player~analyticsInfo

isSupportTrickPlay()

Returns true the stream is support the trick mode.

Returns:

True if the trick mode is available for the stream. False if not.

Type
boolean

setTrickPlay(rate)

Start/Cancel the trick mode play.

Parameters:
Name Type Description
rate number

the trick mode play rate. The value could be -16, -8, -4, -2, -1, 1, 2, 4, 8, 16. It would cancel the trick mode play when it is 1.


cancelTrickPlay()

Cancel the trick mode play.


getCurrentLiveLatency()

Returns the current live latency.

Returns:

The current live latency.

Type
string

getCurrentTimeForLocal()

Returns get the current play time as device time format.

Returns:

The current play time as device time format.

Type
number

Type Definitions


config

Type:
  • object
Properties:
Name Type Description
playback module:Player~playbackConfig

Playback config settings.

analytics Array

The configurations of the analytics. An array of module:Player~analyticsAgent object.

cast module:Player~castConfig

The configurations of chromecast.

advanced module:Player~advancedConfig

An object specifying advanced configurations.

logs module:Player~logsConfig

Log settings.

advertising module:Player~adConfig

Advertising settings.

Example
{
  playback: {
      autoPlay: true
  },
  analytics: [
     {
         type: 'server',
         options: {
             cuid: 123456 // customer specified user ID for Analytics Agent
         }
     },
  ],
  cast: {
      receiverAppId: 'B5BCD208'
  },
  logs: {
      logToConsole: false
  },
  advertising: {
      tag: 'https://your.ad.provider/ad-manifest.xml',
      forceNonLinearFullSlot: true,
      locale: 'en',
      vpaidmode: 'insecure',
      companions : []
  },
  advanced: {
      segmentDownloadRetryCount: 3,
      segmentDownloadRetryDelay: 1000
  }
}

playbackConfig

Type:
  • object
Properties:
Name Type Description
autoPlay boolean

Enables or disables the auto playback at begining of the playback.


analyticsAgent

Type:
  • object
Properties:
Name Type Description
type string

Indicates the kind of analytics Agent, the value may be 'server', 'verspective' or 'agama'.

options module:Player~analyticsAgentOption

Customer specified the config for Analytics Agent.


analyticsAgentOption

Type:
  • object
Properties:
Name Type Description
cuid string

Customer specified user ID for Analytics Agent. The maximal length is 64.


analyticsCustomData

Type:
  • object
Properties:
Name Type Description
cd1 string

Indicates the analytics custom dimension 1.

cd2 string

Indicates the analytics custom dimension 2.

cd3 string

Indicates the analytics custom dimension 3.

cd4 string

Indicates the analytics custom dimension 4.

cm1 number

Indicates the analytics custom metrics 1.

cm2 number

Indicates the analytics custom metrics 2.

cm3 number

Indicates the analytics custom metrics 3.

cm4 number

Indicates the analytics custom metrics 4.


castConfig

Type:
  • object
Properties:
Name Type Description
receiverAppId string

The Chromecast receiver application ID.


logsConfig

Type:
  • object
Properties:
Name Type Description
logToConsole boolean

Turn on/off the log to console, default is false.


companionAdConfig

Type:
  • object
Properties:
Name Type Description
width number

Width of the companion ad slot.

height number

Height of the companion ad slot.


adConfig

Type:
  • object
Properties:
Name Type Description
tag string

The URL of the VAST/VMAP/VPAID tag to display.

forceNonLinearFullSlot boolean

Forces non-linear AdSense ads to render as linear fullslot. If set, the content video will be paused and the non-linear text or image ad will be rendered as fullslot. The content video will resume once the ad has been skipped or closed.

locale string

Sets the publisher provided locale. The locale specifies the language in which to display UI elements and can be any two-letter ISO 639-1 code.

vpaidmode string

Sets VPAID playback mode.
"disabled": VPAID ads will not play and an error will be returned.
"enabled": VPAID ads are enabled using a cross domain iframe. The VPAID ad cannot access the site. VPAID ads that depend on friendly iframe access may error. This is the default.
"insecure": VPAID ads are enabled using a friendly iframe. This allows the ad access to the site via JavaScript.

companions Array

An array of module:Player~companionAdConfig that describes desired companion ads with specific width and height, player will return an array of companion ads that matches the size when trigger VO_OSMP_AD_COMPANION event.


advancedConfig

Type:
  • object
Properties:
Name Type Description
segmentDownloadRetryCount number

The maximum number of retries for downloading the corresponding segment, the number should be an integer. Default is 4.

segmentDownloadRetryDelay number

The delaytime of retries for downloading the corresponding segment, the number should be an integer. Default is 1000ms.


posterConfig

Type:
  • object
Properties:
Name Type Description
url string

The image url of poster

width string

The width of poster display area

height string

The height of poster display area

top string

The top of poster to the video's border.

left string

The left of poster to the video's border.


sourceAdvancedConfig

Type:
  • object
Properties:
Name Type Description
lowLatencyMode boolean

Enable the low latency mode or not. Default is false. Currently, the low latency mode can be only used for the live stream on the Safari and Chrome.

startWithLowestLatency boolean

It indicates whether the first sample start at close to the live edge or not at low latency mode. Default is false.

analyticsCustomData object

It indicates the anaytics custom dimensions and custom metrics. see: module:Player~analyticsCustomData


sourceConfig

Type:
  • object
Properties:
Name Type Description
poster object

The poster info of this video content. see: module:Player~posterConfig

links Array

An array of module:Player~sourceConfigLink object. The SDK will play the uri of the sourceConfigLink object that matches the browser DRM requirement, Widevine for Chrome/Firefox, PlayReady for IE/EDGE and FairPlay for Safari. If more than one sourceConfigLink object match the browser DRM requirement, the uri of the first matching sourceConfigLink object in the array will play.

tracks Array

An array of module:Player~sourceConfigTrack objects with timed data.

advanced object

Advanced configuration of source. see: module:Player~sourceAdvancedConfig

Example
{
      poster: {
          url: "image_url.jpg",
          width: "500px",
          height: "300px",
          top: "20%",
          left: "20%"
      },
      links: [
      {
          uri: "myFairplayStream.m3u8",
          drm: {
              fairplay: {
                  laUrl: 'https://myfairplay.licenseserver.com/',
                  certificateUrl: 'https://myfairplay.licenseserver.com/cert',
                  headers: { 'header1': 'token1', 'header2': 'token2'},
                  withCredentials: true,
                  licenseResponseType: 'text',
                  isResponseBase64Encode: true,
                  useUint8InitData: false,
                  buildMessage: function (event, session) {
                      return JSON.stringify({spc: event.messageBase64Encoded });
                  },
                  processLicense: function (responseText) {
                      return JSON.parse(responseText).ckc;
                  },
                  extractContentId: function (contentId) {
                      var hostname = "invalid.";
                      var pos = contentId.indexOf('skd://');
                      if (pos >= 0) {
                          hostname = contentId.substring(pos + 6);
                      }
                      return hostname;
                  }
              }
          },
          options: {
              manifestWithCredentials: true,
              segmentWithCredentials: false
          }
      }, {
          uri: "myWidevineStream.mpd",
          drm: {
              widevine: {
                  laUrl: "https://mywidevineurl.com/drm",
                  headers: { 'header1': 'token1', 'header2': 'token2'},
                  withCredentials: false
              }
          }
      }, {
          uri: "myPlayreadyStream.mpd",
          drm: {
              playready: {
                  laUrl: "https://myplayreadyurl.com/drm"
               }
          }
      }, {
          uri: "myClearkeyStream.mpd",
          drm: {
              clearkey: {
                  keys: { "1234clear5678key" : "fefde00d-efde-adbf-eff1-baadf01dd11d", "5678clear1234key" : "baadf01dd11d-efde-adbf-eff1-fefde00d" }
              }
          }
      }, {
          uri: "https://path/to/mp4",
      }],
      tracks: [{
          uri: 'https://path/to/thumbnail/vtt/url.vtt',
          type: 'thumbnails'
      }, {
          uri: 'http://path/to/externalSubtitle/ttml/url.ttml',
          lang: 'unknown',
          default: true,
          type: 'externalSubtitle'
      }],
      advanced: {
         lowLatencyMode: false,
         startWithLowestLatency: false,
         anlyticsCustomData: {
             cd1: 'movie1',
             cd2: 'movie2',
             cd3: 'movie3',
             cd4: 'movie4',
             cm1: 1,
             cm2: 2,
             cm3: 3,
             cm4: 4
         }
      }
  }

sourceConfigTrack

Type:
  • object
Properties:
Name Type Argument Description
uri string

The URI of the timed text file,i.e. WebVTT file.

lang string <optional>

The language of the text track, indicates as 'unknown' if it is not defined. It is not used for thumbnail.

default boolean <optional>

Set it as true if want the subtitle is displayed at the current time. It is not used for thumbnail.

type string

The type of timed data. Currently supports "thumbnails" and "externalSubtitle".


Type:
  • object
Properties:
Name Type Description
uri string

The URI of the link to play.

drm module:Player~drmInfo

The drm information of this link.

options module:Player~sourceConfigOptions

Some advanced source specific options.


drmInfo

Type:
  • object
Properties:
Name Type Description
fairplay module:Player~fairplayConfig

An object of fairplay drm configurations.

widevine module:Player~widevineConfig

An object of widevine drm configurations.

playready module:Player~playreadyConfig

An object of playready drm configurations.

clearkey module:Player~clearkeyConfig

An object of clearkey drm configurations.


fairplayConfig

Type:
  • object
Properties:
Name Type Description
laUrl string

The URL of the license acquisition server.

certificateUrl string

The certificate path used by fairplay.

headers object

An object which specify custom HTTP headers. It is json key-value format.

certificateHeaders object

An object which specify custom HTTP headers for requesting certificate file. It is json key-value format.

withCredentials boolean

Sets to true to send credentials such as cookies or authorization headers along with the license requests. Default is false.

licenseResponseType string

Sets response type for the license request. Default response type for this request is 'arraybuffer'.

isResponseBase64Encode boolean

Sets to true to indicate that the response returned from processLicense function is a Base64-encoded string. Default is false.

useUint8InitData boolean

True means initialization data type is Uint8Array, false means initialization data type is Uint16Array. Default is false.

maxLicenseRequestRetries number

The max license request count, the number should be an integer. Default is 0.

licenseRequestRetryDelay number

The license request delay, the number should be an integer. Default is 100ms.

buildMessage function

This function is used to build the license acquisition message to be sent to the license server. If the message property of key message event object returned by the video element's 'webkitkeymessage' message callback can't be sent to the license server directly, then this function is needed. The first parameter is the key message event object returned by the video element's 'webkitkeymessage' message callback, with an enhanced messageBase64Encoded attribute which contains the key message encoded as base64 encoded string. The second parameter is the session object. The return value is the message to be sent to the license server.

processLicense function

This function is used to process the response returned by the license server and returns the key used to update the active key session. If the response can't be used to update the key session directly(e.g. the response is a JSON object), then this function is needed. The parameter is the the response returned by the license server. The return value is the key used to update the active key session. If the key is a Base64-encoded string, please also set isResponseBase64Encode as true.

extractContentId function

This function is used to extract contentId. The parameter is the initData uri (already converted to a string) from the needkey event. The return value should be contentId and it's type should be string. The returned contentId is part of the session data used to initialize the keySession.

processLicenseAsync function

This function is similar to processLicense but it can process license asynchronously. Besides, it must return a promise and the parameter for the resolve function should be Uint8Array. If the key can only be extracted asynchronously then this function is needed.

processCertificate function

This function is used to process the certificate. If the server response can't be used as the certificate directly then this function is needed. The parameter is the server response. The return type is expected to be an ArrayBuffer.

Example
fairplay: {
      laUrl: 'https://myfairplay.licenseserver.com/',
      certificateUrl: 'https://myfairplay.licenseserver.com/cert',
      certificateHeaders: { 'header1': 'token1', 'header2': 'token2' },
      headers: { 'header1': 'token1', 'header2': 'token2' },
      withCredentials: true,
      licenseResponseType: 'text',
      isResponseBase64Encode: true,
      useUint8InitData: false,
      buildMessage: function (event, session) {
          return JSON.stringify({spc: event.messageBase64Encoded });
      },
      processLicense: function (responseText) {
          return JSON.parse(responseText).ckc;
      },
      extractContentId: function (contentId) {
          var hostname = "invalid.";
          var pos = contentId.indexOf('skd://');
          if (pos >= 0) {
              hostname = contentId.substring(pos + 6);
          }
          return hostname;
      }
  }

widevineConfig

Type:
  • object
Properties:
Name Type Description
laUrl string

The URL of the license acquisition server.

headers object

An object which specify custom HTTP headers. It is json key-value format.

withCredentials boolean

Set to true to send credentials such as cookies or authorization headers along with the license requests. Default is false.

maxLicenseRequestRetries number

The max license request retries, the number should be an integer. Default is 0.

licenseRequestRetryDelay number

The license request delay, the number should be an integer. Default is 100ms.

Example
widevine: {
     laUrl: "https://mywidevineurl.com/drm",
     headers: { 'header1': 'token1', 'header2': 'token2'},
     withCredentials: false
 }

playreadyConfig

Type:
  • object
Properties:
Name Type Description
laUrl string

The URL of the license acquisition server.

headers object

An object which specify custom HTTP headers. It is json key-value format.

withCredentials boolean

Set to true to send credentials such as cookies or authorization headers along with the license requests. Default is false.

maxLicenseRequestRetries number

The max license request retries, the number should be an integer. Default is 0.

licenseRequestRetryDelay number

The license request delay, the number should be an integer. Default is 100ms.

Example
playready: {
     laUrl: "https://myplayreadyurl.com/drm",
     headers: { 'header1': 'token1', 'header2': 'token2'},
     withCredentials: false
 }

clearkeyConfig

Type:
  • object
Properties:
Name Type Description
laUrl string

The URL of the license acquisition server.

keys object

An object which specify clear key pairs. It is json key-value format.

withCredentials boolean

Set to true to send credentials such as cookies or authorization headers along with the license requests. Default is false.

maxLicenseRequestRetries number

The max license request retries, the number should be an integer. Default is 0.

licenseRequestRetryDelay number

The license request delay, the number should be an integer. Default is 100ms.

Example
clearkey: {
      laUrl: "https://myclearurl.com/drm",
      keys: { "1234clear5678key":"fefde00d-efde-adbf-eff1-baadf01dd11d", "5678clear1234key":"baadf01dd11d-efde-adbf-eff1-fefde00d"}
      withCredentials: false,
      maxLicenseRequestRetries: 3,
      licenseRequestRetryDelay: 200
  }

sourceConfigOptions

Type:
  • object
Properties:
Name Type Description
manifestWithCredentials boolean

Sends credentials and cookies along with cross origin manifest requests. Must be supported by the server. Default is false.

segmentWithCredentials boolean

Sends credentials and cookies along with cross origin segment requests. Must be supported by the server. Default is false.


endCause

Type:
  • object
Properties:
Name Type Description
'UNKNOWN' strings

(value=-1)

'END_OF_UPDOWN' strings

(value=0)The viewing was stopped by pressing the up/down button

'END_OF_CALL' strings

(value=1)The viewing was stopped by a mobile call

'END_OF_ASSET' strings

(value=2)The viewing reached the end of the asset being viewed

'TERMINATED_BY_USER' strings

(value=3)The user stopped the viewing session

'TERMINATED_BY_APP' strings

(value=4)The application stopped the viewing session


TimeRange

Type:
  • object
Properties:
Name Type Description
start number

Start time of the range.

end number

End time of the range.

See:

qualityLevel

Type:
  • object
Properties:
Name Type Description
codec string

The codec information of the quality level.

id string

The id of the quality level.

mimeType string

The mimetype of the quality level.

lang string

The language of the quality level.

viewpoint string

The viewpoint of the quality level.

type string

The type of the quality level.

bandwidth number

The bandwidth of the quality level.

height number

The height of the quality level.

width number

The width of the quality level.

See:

audioTrack

Type:
  • object
Properties:
Name Type Description
codec string

The codec information of the audio track.

id string

The id of the audio track.

mimeType string

The MIME Type of the audio track.

lang string

The language of the audio track.

type string

The type of the audio track.

bandwidth number

The bandwidth of the audio track.

name string

The name of the audio track.

See:

subtitleTrack

Type:
  • object
Properties:
Name Type Description
id string

The id of the subtitle track.

lang string

The language of the subtitle track.

type string

The type of the subtitle track.

label string

The label of the subtitle track.

See:

fontBackgroundColor

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value string

The value of the property.


fontBackgroundOpacity

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value float

The value of the property.


fontColor

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value string

The value of the property.


fontOpacity

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value float

The value of the property.


fontFamily

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value string

The value of the property.


fontEdgeType

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value string

The value of the property.


fontEdgeColor

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value string

The value of the property.


fontEdgeOpacity

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value float

The value of the property.


fontSize

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value string

The value of the property.


fontBold

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value boolean

The value of the property.


fontUnderline

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value boolean

The value of the property.


fontItalic

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value boolean

The value of the property.


windowColor

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value string

The value of the property.


windowOpacity

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value float

The value of the property.


boundingBox

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value module:Player~boundingBoxValue

The value of the property.


fontHorzPosition

Type:
  • object
Properties:
Name Type Description
enable boolean

True means enable the property, false means disable the property.

value string

The value of the property.


boundingBoxValue

Type:
  • object
Properties:
Name Type Description
left string

The left position of the bounding box.

top string

The top position of the bounding box.

right string

The right position of the bounding box.

bottom string

The bottom position of the bounding box.


subtitleStyles

Type:
  • object
Properties:
Name Type Description
enable boolean

Enable all subtitles properties or not.

previewSubtitleText string

Set the preview text string.

fontBackgroundColor module:Player~fontBackgroundColor

Set font background color.

fontBackgroundOpacity module:Player~fontBackgroundOpacity

Set font background opacity.

fontColor module:Player~fontColor

Set font color.

fontOpacity module:Player~fontOpacity

Set font opacity.

fontFamily module:Player~fontFamily

Set font name.

fontEdgeType module:Player~fontEdgeType

Set font edge type.

fontEdgeColor module:Player~fontEdgeColor

Set font edge color.

fontEdgeOpacity module:Player~fontEdgeOpacity

Set font edge opacity.

fontSize module:Player~fontSize

Set font size.

fontBold module:Player~fontBold

Set font bold or not.

fontUnderline module:Player~fontUnderline

Set font underline or not.

fontItalic module:Player~fontItalic

Set font italic or not.

windowColor module:Player~windowColor

Set window background color.

windowOpacity module:Player~windowOpacity

Set window background opacity.

boundingBox module:Player~boundingBox

Set bounding box position.

fontHorzPosition module:Player~fontHorzPosition

Set font horizontal position.

Example
{
 enable: true,
 previewSubtitleText: "preview text content",
 fontBackgroundColor: {
     enable: false,
     value: 'black'
 },
 fontBackgroundOpacity: {
     enable: false,
     value: 0.50
 },
 fontColor: {
     enable: false,
     value: 'white'
 },
 fontOpacity: {
     enable: false,
     value: 0.75
 },
 fontFamily: {
     enable: false,
     value: 'Arial'
 },
 fontEdgeType: {
     enable: false,
     value: 'raised'
 },
 fontEdgeColor: {
     enable: false,
     value: 'blue'
 },
 fontEdgeOpacity: {
     enable: false,
     value: 0.50
 },
 fontSize: {
     enable: false,
     value: '150%'
 },
 fontBold: {
     enable: false,
     value: false
 },
 fontUnderline: {
     enable: false,
     value: false
 },
 fontItalic: {
     enable: false,
     value: false
 },
 windowColor: {
     enable: false,
     value: 'black'
 },
 windowOpacity: {
     enable: false,
     value: 0.25
 },
 boundingBox: {
     enable: false,
     value: {
         left: '10%',
         top: '90%',
         right: '84%',
         bottom: '92%'
     }
},
fontHorzPosition: {
     enable: false,
     value: 'center'
}
}

thumbnailInfo

Type:
  • object
Properties:
Name Type Description
start number

Start time of the thumbnail.

end number

End time of the thumbnail.

x number

Horizontal offset of the thumbnail.

y number

Vertical offset of the thumbnail.

width number

Width of the thumbnail.

height number

Height of the thumbnail.

url string

The thumbnail url.

See:

externalSubtitleInfo

Type:
  • object
Properties:
Name Type Description
uri string

The external subtitle uri.

lang string

The language of the text track, indicates as 'unknown' if it is not defined.

default boolean

Set it as true if want the subtitle is displayed at the current time.

See:
Example
{
 uri: 'https://path/to/external/vtt/url.vtt',
 lang: 'english',
 default: true
}

analyticsInfo

Type:
  • object
Properties:
Name Type Description
startupTime string

The time when the first frame is rendered after invoking the playback or channel switch. The unit is msec.

playTime string

The accumulated time that the player plays the asset, excluding buffering, seeking time, pausing and so on. The unit is msec.

bufferingTime string

The accumulated buffering time. The unit is msec.

streamingFps string

The the frame rate of streaming.

streamingBitrate string

The bitrate of the streaming(load bytes / load duration). The unit is kbps.

bandwidth string

The bitrate of the current stream. The unit is kbps.

adaptations number

The sum of bit rate adaptation up count and down count.

totalFrames number

The total frame count.

droppedFrames number

The dropped frame count.

downloadTime number

The aggregated time for downloading the data.

downloadBytes number

The total downloaded bytes.

droppedBytes number

The dropped bytes.

vidoLinkURL string

The video url.

playerVersion string

The player version.

resolution string

The video resolution.

streamType string

The stream type(vod or live).