Methods
-
init(config)
-
Initializes the Player.
This method must be called before any other methods.Parameters:
Name Type Description configmodule: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 sourcemodule:Player~sourceConfig The media source to be opened.
- See:
-
addEventListener(event, callback, scope)
-
Adds listener to listen event in
voEvents.Parameters:
Name Type Description eventvoEvents Event defined in
voEvents.callbackfunction Callback method when the event fires.
scopeobject Context of the callback that can ensure the callback to be added properly.
-
removeEventListener(event, callback, scope)
-
Removes the event listener.
Parameters:
Name Type Description eventvoEvents Event defined in
voEvents.callbackfunction Callback method when the event fires.
scopeobject Context of the callback that can ensure the callback to be removed properly.
- See:
-
play()
-
Starts playing the current audio or video.
-
pause()
-
Halts (pauses) the currently playing audio or video.
-
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 endCausestrings if with this param, send stop event to Verspective Analytics Export. - See:
-
- Note: about param endCause value, please click
module:Player~endCause
- Note: about param endCause value, please click
Example
{ stop(); stop('TERMINATED_BY_USER'); //send stop event to Verspective Analytics Export } -
close()
-
Closes the player instance.
-
setPosition(pos)
-
Sets the current position (in seconds) of the audio/video playback.
Parameters:
Name Type Description posnumber 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.
-
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.
-
unmute()
-
Unmutes the player if muted.
-
isMuted()
-
Returns true if the player has been muted.
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 volumenumber 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 widthnumber The new width of ad window in pixels.
heightnumber 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~qualityLevelobjects 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~audioTrackobjects 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~subtitleTrackobjects of current selected quality level.- Type
- Array
-
selectQualityLevel(id)
-
Selects the required quality level.
Parameters:
Name Type Description idstring The id property of a quality level object.
-
selectAudioTrack(id)
-
Selects the required audio track.
Parameters:
Name Type Description idstring The id property of a audio track object.
-
selectSubtitleTrack(id)
-
Selects the required subtitle track by id.
Parameters:
Name Type Description idstring 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.
-
getCurrentAudioTrack()
-
Returns the object of the current active audio track.
Returns:
The object of the current active audio track.
-
getCurrentSubtitleTrack()
-
Returns the object of the current active subtitle track.
Returns:
The object of the current active subtitle track.
-
setSubtitleStyles(subStyles)
-
Sets current text track styles.
Parameters:
Name Type Description subStylesmodule:Player~subtitleStyles Subtitle style configurations.
-
getDefaultSubtitleStyles()
-
Returns the default subtitle styles.
Returns:
The object of default subtitle styles.
-
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 typestring 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 speedfloat 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 posnumber 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.
-
isPipSupported()
-
Returns true if the PIP is supported by the specific browser. (Safari or Chrome70+)
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+)
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 showboolean Turn on/off the PIP mode. If no video link is playing, or pure audio link is playing, player cannot enter into PIP mode.
-
isAirplaySupported()
-
Returns true if the airplay is supported by the current browser. (Safari Only)
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 subtitlemodule:Player~externalSubtitleInfo External subtitle settings.
- See:
-
- Note: The external subtitle could be set before the playback and during the playback.
It is set as amodule:Player~sourceConfigTrackobject ofmodule:Player~sourceConfigif the external subtitle is set before playback.
It calls the API if the external subtitle is set during the playback.
- Note: The external subtitle could be set before the playback and during the playback.
-
getAnalyticsInfo()
-
Returns the analytics information.
Returns:
The analytics information.
-
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 ratenumber 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 playbackmodule:Player~playbackConfig Playback config settings.
analyticsArray The configurations of the analytics. An array of
module:Player~analyticsAgentobject.castmodule:Player~castConfig The configurations of chromecast.
advancedmodule:Player~advancedConfig An object specifying advanced configurations.
logsmodule:Player~logsConfig Log settings.
advertisingmodule: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 autoPlayboolean Enables or disables the auto playback at begining of the playback.
-
analyticsAgent
-
Type:
- object
Properties:
Name Type Description typestring Indicates the kind of analytics Agent, the value may be 'server', 'verspective' or 'agama'.
optionsmodule:Player~analyticsAgentOption Customer specified the config for Analytics Agent.
-
analyticsAgentOption
-
Type:
- object
Properties:
Name Type Description cuidstring Customer specified user ID for Analytics Agent. The maximal length is 64.
-
analyticsCustomData
-
Type:
- object
Properties:
Name Type Description cd1string Indicates the analytics custom dimension 1.
cd2string Indicates the analytics custom dimension 2.
cd3string Indicates the analytics custom dimension 3.
cd4string Indicates the analytics custom dimension 4.
cm1number Indicates the analytics custom metrics 1.
cm2number Indicates the analytics custom metrics 2.
cm3number Indicates the analytics custom metrics 3.
cm4number Indicates the analytics custom metrics 4.
-
castConfig
-
Type:
- object
Properties:
Name Type Description receiverAppIdstring The Chromecast receiver application ID.
-
logsConfig
-
Type:
- object
Properties:
Name Type Description logToConsoleboolean Turn on/off the log to console, default is false.
-
companionAdConfig
-
Type:
- object
Properties:
Name Type Description widthnumber Width of the companion ad slot.
heightnumber Height of the companion ad slot.
-
adConfig
-
Type:
- object
Properties:
Name Type Description tagstring The URL of the VAST/VMAP/VPAID tag to display.
forceNonLinearFullSlotboolean 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.
localestring 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.
vpaidmodestring 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.companionsArray An array of
module:Player~companionAdConfigthat describes desired companion ads with specific width and height, player will return an array of companion ads that matches the size when triggerVO_OSMP_AD_COMPANIONevent. -
advancedConfig
-
Type:
- object
Properties:
Name Type Description segmentDownloadRetryCountnumber The maximum number of retries for downloading the corresponding segment, the number should be an integer. Default is 4.
segmentDownloadRetryDelaynumber 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 urlstring The image url of poster
widthstring The width of poster display area
heightstring The height of poster display area
topstring The top of poster to the video's border.
leftstring The left of poster to the video's border.
-
sourceAdvancedConfig
-
Type:
- object
Properties:
Name Type Description lowLatencyModeboolean 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.
startWithLowestLatencyboolean It indicates whether the first sample start at close to the live edge or not at low latency mode. Default is false.
analyticsCustomDataobject It indicates the anaytics custom dimensions and custom metrics. see:
module:Player~analyticsCustomData -
sourceConfig
-
Type:
- object
Properties:
Name Type Description posterobject The poster info of this video content. see:
module:Player~posterConfiglinksArray An array of
module:Player~sourceConfigLinkobject. 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.tracksArray An array of
module:Player~sourceConfigTrackobjects with timed data.advancedobject Advanced configuration of source. see:
module:Player~sourceAdvancedConfigExample
{ 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 uristring The URI of the timed text file,i.e. WebVTT file.
langstring <optional>
The language of the text track, indicates as 'unknown' if it is not defined. It is not used for thumbnail.
defaultboolean <optional>
Set it as true if want the subtitle is displayed at the current time. It is not used for thumbnail.
typestring The type of timed data. Currently supports "thumbnails" and "externalSubtitle".
-
sourceConfigLink
-
Type:
- object
Properties:
Name Type Description uristring The URI of the link to play.
drmmodule:Player~drmInfo The drm information of this link.
optionsmodule:Player~sourceConfigOptions Some advanced source specific options.
-
drmInfo
-
Type:
- object
Properties:
Name Type Description fairplaymodule:Player~fairplayConfig An object of fairplay drm configurations.
widevinemodule:Player~widevineConfig An object of widevine drm configurations.
playreadymodule:Player~playreadyConfig An object of playready drm configurations.
clearkeymodule:Player~clearkeyConfig An object of clearkey drm configurations.
-
fairplayConfig
-
Type:
- object
Properties:
Name Type Description laUrlstring The URL of the license acquisition server.
certificateUrlstring The certificate path used by fairplay.
headersobject An object which specify custom HTTP headers. It is json key-value format.
certificateHeadersobject An object which specify custom HTTP headers for requesting certificate file. It is json key-value format.
withCredentialsboolean Sets to true to send credentials such as cookies or authorization headers along with the license requests. Default is false.
licenseResponseTypestring Sets response type for the license request. Default response type for this request is 'arraybuffer'.
isResponseBase64Encodeboolean Sets to true to indicate that the response returned from processLicense function is a Base64-encoded string. Default is false.
useUint8InitDataboolean True means initialization data type is Uint8Array, false means initialization data type is Uint16Array. Default is false.
maxLicenseRequestRetriesnumber The max license request count, the number should be an integer. Default is 0.
licenseRequestRetryDelaynumber The license request delay, the number should be an integer. Default is 100ms.
buildMessagefunction 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.
processLicensefunction 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.
extractContentIdfunction 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.
processLicenseAsyncfunction 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.
processCertificatefunction 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 laUrlstring The URL of the license acquisition server.
headersobject An object which specify custom HTTP headers. It is json key-value format.
withCredentialsboolean Set to true to send credentials such as cookies or authorization headers along with the license requests. Default is false.
maxLicenseRequestRetriesnumber The max license request retries, the number should be an integer. Default is 0.
licenseRequestRetryDelaynumber 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 laUrlstring The URL of the license acquisition server.
headersobject An object which specify custom HTTP headers. It is json key-value format.
withCredentialsboolean Set to true to send credentials such as cookies or authorization headers along with the license requests. Default is false.
maxLicenseRequestRetriesnumber The max license request retries, the number should be an integer. Default is 0.
licenseRequestRetryDelaynumber 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 laUrlstring The URL of the license acquisition server.
keysobject An object which specify clear key pairs. It is json key-value format.
withCredentialsboolean Set to true to send credentials such as cookies or authorization headers along with the license requests. Default is false.
maxLicenseRequestRetriesnumber The max license request retries, the number should be an integer. Default is 0.
licenseRequestRetryDelaynumber 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 manifestWithCredentialsboolean Sends credentials and cookies along with cross origin manifest requests. Must be supported by the server. Default is false.
segmentWithCredentialsboolean 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
- See:
Properties:
Name Type Description startnumber Start time of the range.
endnumber End time of the range.
-
qualityLevel
-
Type:
- object
- See:
Properties:
Name Type Description codecstring The codec information of the quality level.
idstring The id of the quality level.
mimeTypestring The mimetype of the quality level.
langstring The language of the quality level.
viewpointstring The viewpoint of the quality level.
typestring The type of the quality level.
bandwidthnumber The bandwidth of the quality level.
heightnumber The height of the quality level.
widthnumber The width of the quality level.
-
audioTrack
-
Type:
- object
- See:
Properties:
Name Type Description codecstring The codec information of the audio track.
idstring The id of the audio track.
mimeTypestring The MIME Type of the audio track.
langstring The language of the audio track.
typestring The type of the audio track.
bandwidthnumber The bandwidth of the audio track.
namestring The name of the audio track.
-
subtitleTrack
-
Type:
- object
- See:
Properties:
Name Type Description idstring The id of the subtitle track.
langstring The language of the subtitle track.
typestring The type of the subtitle track.
labelstring The label of the subtitle track.
-
fontBackgroundColor
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valuestring The value of the property.
-
fontBackgroundOpacity
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valuefloat The value of the property.
-
fontColor
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valuestring The value of the property.
-
fontOpacity
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valuefloat The value of the property.
-
fontFamily
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valuestring The value of the property.
-
fontEdgeType
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valuestring The value of the property.
-
fontEdgeColor
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valuestring The value of the property.
-
fontEdgeOpacity
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valuefloat The value of the property.
-
fontSize
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valuestring The value of the property.
-
fontBold
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valueboolean The value of the property.
-
fontUnderline
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valueboolean The value of the property.
-
fontItalic
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valueboolean The value of the property.
-
windowColor
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valuestring The value of the property.
-
windowOpacity
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valuefloat The value of the property.
-
boundingBox
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valuemodule:Player~boundingBoxValue The value of the property.
-
fontHorzPosition
-
Type:
- object
Properties:
Name Type Description enableboolean True means enable the property, false means disable the property.
valuestring The value of the property.
-
boundingBoxValue
-
Type:
- object
Properties:
Name Type Description leftstring The left position of the bounding box.
topstring The top position of the bounding box.
rightstring The right position of the bounding box.
bottomstring The bottom position of the bounding box.
-
subtitleStyles
-
Type:
- object
Properties:
Name Type Description enableboolean Enable all subtitles properties or not.
previewSubtitleTextstring Set the preview text string.
fontBackgroundColormodule:Player~fontBackgroundColor Set font background color.
fontBackgroundOpacitymodule:Player~fontBackgroundOpacity Set font background opacity.
fontColormodule:Player~fontColor Set font color.
fontOpacitymodule:Player~fontOpacity Set font opacity.
fontFamilymodule:Player~fontFamily Set font name.
fontEdgeTypemodule:Player~fontEdgeType Set font edge type.
fontEdgeColormodule:Player~fontEdgeColor Set font edge color.
fontEdgeOpacitymodule:Player~fontEdgeOpacity Set font edge opacity.
fontSizemodule:Player~fontSize Set font size.
fontBoldmodule:Player~fontBold Set font bold or not.
fontUnderlinemodule:Player~fontUnderline Set font underline or not.
fontItalicmodule:Player~fontItalic Set font italic or not.
windowColormodule:Player~windowColor Set window background color.
windowOpacitymodule:Player~windowOpacity Set window background opacity.
boundingBoxmodule:Player~boundingBox Set bounding box position.
fontHorzPositionmodule: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
- See:
-
- Note: The value of x/y/width/height is undefined if thumbnail is plain image.
findNearestThumbnail()
Properties:
Name Type Description startnumber Start time of the thumbnail.
endnumber End time of the thumbnail.
xnumber Horizontal offset of the thumbnail.
ynumber Vertical offset of the thumbnail.
widthnumber Width of the thumbnail.
heightnumber Height of the thumbnail.
urlstring The thumbnail url.
-
externalSubtitleInfo
-
Type:
- object
- See:
Properties:
Name Type Description uristring The external subtitle uri.
langstring The language of the text track, indicates as 'unknown' if it is not defined.
defaultboolean Set it as true if want the subtitle is displayed at the current time.
Example
{ uri: 'https://path/to/external/vtt/url.vtt', lang: 'english', default: true } -
analyticsInfo
-
Type:
- object
Properties:
Name Type Description startupTimestring The time when the first frame is rendered after invoking the playback or channel switch. The unit is msec.
playTimestring The accumulated time that the player plays the asset, excluding buffering, seeking time, pausing and so on. The unit is msec.
bufferingTimestring The accumulated buffering time. The unit is msec.
streamingFpsstring The the frame rate of streaming.
streamingBitratestring The bitrate of the streaming(load bytes / load duration). The unit is kbps.
bandwidthstring The bitrate of the current stream. The unit is kbps.
adaptationsnumber The sum of bit rate adaptation up count and down count.
totalFramesnumber The total frame count.
droppedFramesnumber The dropped frame count.
downloadTimenumber The aggregated time for downloading the data.
downloadBytesnumber The total downloaded bytes.
droppedBytesnumber The dropped bytes.
vidoLinkURLstring The video url.
playerVersionstring The player version.
resolutionstring The video resolution.
streamTypestring The stream type(vod or live).
voPlayer