#
new AmcManager(requestUrl, ownerUid, userToken, sessionUid, deviceId)
Session constructor based on the MRR-MP URL, owner ID, and user token. To see how this method is used.
Guidelines and Restrictions:
- The URL must begin with either http:// or https:// or the WMC will send the app the IMC_STATUS_INVALID_URL error).
Parameters:
Name |
Type |
Description |
requestUrl |
string
|
DNS and port of the MRR-MP and application prefix, if any. |
ownerUid |
string
|
Owner unique identifier. |
userToken |
string
|
Identifier of the user that is currently logged in. |
sessionUid |
string
|
only used for chromecast to keep same session id. |
deviceId |
string
|
** unique device identifier(optional). This parameter is only required for MKP service. |
Methods
#
addEventListener(type, listener)
Sets the listener to receive callbacks from WMC. To see how this method is used, see Playback Complete (p. 26).
Set a listener to receive callbacks from the WMC
Parameters:
Name |
Type |
Description |
type |
number
|
specifies the event type this listener registers for. Refer to AmcEvents for a list of event types. |
listener |
object
|
specifies the callback function |
#
createPlayer(mode, mediaId, appToken)
Instructs WMC to create a player for video rendering. To see how this method is used, see Playback Complete (p. 26).
Instructs the WMC to create a player for video rendering.
Parameters:
Name |
Type |
Description |
mode |
number
|
specifies WMC player mode. The mode has the following options, which are defined in the AmcConstants
IMC_MODE_ADAPTIVE: 0
IMC_MODE_LIVE: 1 |
mediaId |
string
|
specifies the ID of the media |
appToken |
*
|
application-specific token for live and recording asset |
#
deleteAllBookmarks()
Delete all locally saved bookmark positions
#
disableTextTrack(track)
Disable a text track.
Parameters:
Name |
Type |
Description |
track |
object
|
track to disable |
#
enableCC(enabled)
Controls if Closed Caption is showing
Parameters:
Name |
Type |
Description |
enabled |
boolean
|
controls the ability of the WMC to show Closed Caption
- true - CC is enable
- false - CC is not enable
|
#
enableChromecast(value)
Enable/Disable Chromecast.
Parameters:
Name |
Type |
Description |
value |
string
|
should be valid cast id or null. If the value is null then chromecast will be disable or if the value is a valid castid then the player will cast the video |
#
enableMetrics(value)
Enables metrics.
Parameters:
Name |
Type |
Description |
value |
boolean
|
metric status |
#
enableMKPApi(enable) → {boolean}
Switch between conventional and MKP rest interface
This will switch between conventional and MKP rest interface
Parameters:
Name |
Type |
Description |
enable |
boolean
|
true for MKP interface and false for conventional interface
- true MKP rest service
- false Conventional rest service
|
Returns:
- true - Set Successful
- false - Set Failed
-
Type
-
boolean
#
enableTextTrack(track)
Enable a text track.
Parameters:
Name |
Type |
Description |
track |
object
|
track to enable |
#
getAllBookmarks() → {array}
Retrieves an array of bookmark objects.
Get all the bookmark positions.
Returns:
Bookmark objects in which each bookmark object has the following two attributes:
- key - the media UID
- value - the bookmark position (in seconds) of this media
-
Type
-
array
#
getAmcPlayerDetails() → {string}
Returns:
the current WMC version string
-
Type
-
string
#
getAmcVersion() → {string}
Retrieves the current WMC version.
Guidelines and Restrictions
- Use this method to obtain the current WMC version after amcManager is instantiated. To obtain the version before amcManager is instantiated, use the VERSION (p. 70) method
Returns:
- Current WMC version string
-
Type
-
string
#
getAudioTracks() → {object}
Retrieves a list of available audio track IDs and the currently playing audio track.
Get the list of audioTracks contained in the DASH manifest
Returns:
- available audio tracks and the current audio track
- audioTracks - (Array of Strings) Array of available audio track IDs.
- currentAudioTrack - (String) Currently playing audioTrackId
-
Type
-
object
Example
{ audioTracks: ["audio_483_dan", "audio_482_swe"], currentAudioTrack: "audio_483_dan" }
#
getAvailableVideoQualities() → {array}
Returns the list of available video qualities from player..
Returns:
The list of available video qualities.
-
Type
-
array
Example
[{"id":"720_12121172", "label":"1280x720, 6061kbps"},{"id":"1080_16121172", "label":"1920x1080, 8061kbps"}]
#
getBandwidthList() → {array}
Retrieves the list of video bandwidth contained in the DASH manifest, where each bandwidth is in bits per second (bps).
Guidelines and Restrictions
- This method is for use with the DASH player only.
- The Safari web browser on an Apple Mac desktop does not support this method.
Returns:
- an array of bandwidth values. Each bandwidth is in bits per second.
-
Type
-
array
#
getBeaconFailOpenConfig() → {BeaconFailOpenConfig}
Get beacon backoff. This function can be called anytime after WMC instance is created.
Returns:
status of Beacon Fail Open Config
-
Type
-
BeaconFailOpenConfig
#
getBookmark(mediaUid) → {number}
Retrieves the bookmark position (in seconds) for a specific media unique identifier (UID).
Get the bookmark position for a specific media.
Parameters:
Name |
Type |
Description |
mediaUid |
string
|
specifies the UID of the media. |
Returns:
- bookmark position in seconds.
-
Type
-
number
#
getBufferLength() → {object}
Get the audio and video buffer length
Returns the current buffer length value in seconds,
which is the amount of data (in seconds) buffered by the player.
Returns:
bufferLength object containing both video and
audio buffer levels
-
Type
-
object
#
getCCState() → {Boolean}
Get the get Closed Caption State
#
getCurrentAudio() → {object}
Retrieves the currently playing audio track ID.
Get the current audio track
Returns:
- Currently playing audio track ID with the following attribute: currentAudioTrack.
-
Type
-
object
#
getCurrentSubtitle() → {string}
Retrieves the current subtitle being used.
Guidelines and Restrictions
The subtitle feature requires the following items depending on player type:
- Dash player - Requires the following:
-- VSPP 4.3.2 or later
-- TTML format (VSPP default format for DASH)
-- UTF-8 encoding
- HLS player - Requires the following:
-- VTT format (VSPP default format for HLS)
-- VSPP default encoding
Returns:
Current subtitle, or null if subtitle is disabled.
-
Type
-
string
#
getCurrentTime(timeMode) → {number}
Get the player current time based on the time mode.
Parameters:
Name |
Type |
Description |
timeMode |
string
|
- pass 'absolutetime' for the Unix timestamp of the current playback time.
- pass 'relativetime' for the relative timestamp of the current playback time.
|
Returns:
The current time of the player.
-
Type
-
number
#
getDefaultInHomeStatus() → {AZUKI_HOME_STATUS_T}
Get the default inHome status
Returns:
- status of inHome detection server
AZUKI_HOME_STATUS_T.AZUKI_HOME_STATUS_IN: 0
AZUKI_HOME_STATUS_T.AZUKI_HOME_STATUS_OUT: 1
-
Type
-
AZUKI_HOME_STATUS_T
#
getDvrFromRollingBuffer() → {boolean}
Get the rolling buffer value, implemented it for future use.
#
getErrorEventData() → {object}
To collect various ErrorEventData parameters for Analytics usage.
Returns:
Object with error related URLs or Ids for each parameters.
-
Type
-
object
#
getGeofenceCoordinates() → {object}
To get GeoFences Co-ordinates
#
getInHomeDetectionServiceURL() → {string}
Retrieves the third-party product (3PP) in-home detection service URL.
Guidelines and Restrictions
- This method requires MRR-MP 4.5.0.x or later on the backend.
Returns:
In-home detection service URL.
-
Type
-
string
#
getInHomeStatus() → {AZUKI_HOME_STATUS_T}
Get the inHome status
Returns:
status of inHome detection serve
-
Type
-
AZUKI_HOME_STATUS_T
#
getInHomeToken() → {string}
Retrieves the authentication in-home token that is required to access a third-party product (3PP) in-home detection service.
Guidelines and Restrictions
- This method requires MRR-MP 4.5.0.x or later on the backend
#
getPlaybackMetrics() → {any}
Returns the playback metrics.
Example
{"averageBitrate": 129078.5, "bitrateAudioProfiles": [130358], "bitrateAudioTimeStamp": [1630095566490], "bitrateProfiles": [258157, 520929, 831270, 1144430, 1558322, 2487897, 3113198, 4149264, 6214307], "bitrateVideoProfiles": [258157], "bitrateVideoTimeStamp": [1630095566490], "bufferFillTimes": [369, 465], "bytesTransferred": 1153558, "droppedVideoFrames": 0, "durationsWatched": 0, "playbackStalls": 2, "playbackStallsTimeStamp": [1630095586403, 1630095588904], "playbackStartOffsets": 0, "throughputTimeStamps": 0, "throughputValues": 0, "transferDuration": 30740}
#
getPlaySpeed() → {number}
To get current playback rate.
Returns:
The playbackRate property returns the current playback speed of the audio/video.
-
Type
-
number
#
getPlayTimeUTC() → {string}
To get playback time
Returns:
Time in UTC (Universal Time Coordinated) format
-
Type
-
string
#
getProgramInfo() → {string}
Retrieves the following information about the current program for live timeshift:
- pid:String - Program ID
- name:String - Program name
- start:String - Program start time muid:String - Program unique ID
- duration:int - Program duration in seconds
Getting Program Info of the current program
Returns:
Current program information in JSON string format.
-
Type
-
string
Example
{"pid":"LIVE$CF_unenc_205_prg212","name":"LIVE$CF_une nc_205_prg212","start":"2017-08-22 17:40:00","muid":"LIVE$CF_unenc_205","duration":"3000
00"}
#
getSeekableRange() → {any}
Returns the time range that is currently valid for seeking.
Returns:
The seekable range of the player.
-
Type
-
any
Example
{"start":1624951514.26, "end":1624951774.85, "duration": 260.58}
#
getStreamerSlotDuration() → {number}
Get media streamer slot duration being used by WMC.
Returns:
duration - media streamer slot duration in hours (in hours)
-
Type
-
number
#
getSubtitles() → {Array}
Retrieves a list of available subtitles.
Guidelines and Restrictions
The subtitle feature requires the following items depending on player type:
- Dash player - Requires the following:
-- VSPP 4.3.2 or later
-- TTML format (VSPP default format for DASH)
-- UTF-8 encoding
- HLS player - Requires the following:
-- VTT format (VSPP default format for HLS)
-- VSPP default encoding
Returns:
Available subtitles with different languages. If no subtitle is available, an empty array is returned.
-
Type
-
Array
#
getSubtitleState() → {Boolean}
Get the subtitle state
#
getTextTracks() → {array}
Get the list of available text tracks.
#
getVideoDuration() → {number}
Retrieves the video duration in seconds.
Get the duration of the video
Returns:
- current playback position in seconds.
-
Type
-
number
#
getVideoPosition() → {number}
Retrieves the current video playback position in seconds.
Get the current playback position of the video.
Returns:
- Current playback position in seconds.
-
Type
-
number
#
getVolume() → {number}
Get the volume.
Returns:
The current volume of the player.
- decimal value within 0 to 1
-
Type
-
number
#
init(forceRegopt) → {boolean}
Initializes the WMC player and determines if WMC is to register this device.
Initialize the WMC player
Parameters:
Name |
Type |
Attributes |
Description |
forceReg |
boolean
|
<optional>
|
controls if WMC register this device
true; if WMC must register this device
false (default); if WMC does not need to register this device, if this device has already been registered |
#
initialiseGeofence() → {boolean}
To initialise Geofence
#
isFFEnabled() → {boolean}
To check if the fastforward PBR is enabled or not.
Returns:
- true - fast forward enable
- false - fast forward is not enable
-
Type
-
boolean
#
isInSeekableRange(time) → {boolean}
Returns the true/false based on the current seeking time.
Parameters:
Name |
Type |
Description |
time |
number
|
new playback position in seconds. |
Returns:
- true - Can seek
- false - Can't seek due to seek boundary
-
Type
-
boolean
#
isLiveEvent() → {Boolean}
Get the status of live event
#
isLocationServicesEnabled() → {boolean}
To check isEnable Location services or not
#
isReady() → {boolean}
Returns source ready state
#
isRWEnabled() → {boolean}
To check if the rewind PBR is enabled or not
Returns:
- true - rewind enable
- false - rewind is not enable
-
Type
-
boolean
#
isSourceLoaded() → {boolean}
Returns source loading state
#
liveNow()
Specifies that WMC is to start the playback from the current live playback position for timeshift live.
#
pause()
Instructs WMC to pause video playback.
Guidelines and Restrictions
- To see how this method is used, see Playback Pause and Resume (p. 29).
#
preload()
- Deprecated:
- Retained to prevent errors from dependents still using the API. Will be removed in future releases
#
removeEventListener(type, listener)
Removes a listener.
Parameters:
Name |
Type |
Description |
type |
number
|
specifies the event type this listener registered for. Refer to AmcEvents for a list of event types. |
listener |
object
|
specifies the callback function to be removed |
#
reset()
Reset the player
Note: This method is not supported at this time.
#
resume()
Instructs WMC to resume video playback if it was paused.
Guidelines and Restrictions
- To see how this method is used, see Playback Pause and Resume (p. 29).
#
seek(time)
Player seeks to a new playback position. When the seek() method is called the following events occur:
- The client application receives the IMC_STATE_SEEKING state change event.
- During normal playback, the client app receives the IMC_STATE_PLAYING state change event when the seek() is complete.
or
During pause then seek, the client app receives the IMC_STATE_PAUSED state change event when the seek() is complete.
Guidelines and Restrictions
- To see how this method is used, see Playback Seek (p. 28) and Playback Pause and Seek (p. 30).
- Seek is currently not supported when mode is IMC_MODE_LIVE.
Parameters:
Name |
Type |
Description |
time |
number
|
new playback position in seconds. |
#
setAnalyticsConfig(analyticsKey, userId, videoId, videoTitle, experimentName, cdnProvideropt, customDataopt) → {boolean}
Set the analytics config parameters
With a valid analytics license key, set the various analytics config
parameters to publish the analytics data.
Parameters:
Name |
Type |
Attributes |
Description |
analyticsKey |
string
|
|
the unique analytics license key |
userId |
string
|
|
a unique user id |
videoId |
string
|
|
a unique video id |
videoTitle |
string
|
|
a unique video title |
experimentName |
string
|
|
a unique title/name to the analytics test |
cdnProvider |
string
|
<optional>
|
cdn provider name or url |
customData |
string
|
<optional>
|
optional user custom data (up to 25 key is supportated) |
Returns:
true on success, false otherwise
-
Type
-
boolean
Example
wmcMgr.setAnalyticsConfig("***************");
#
setAnalyticsEnabled(analyticsEnabled) → {boolean}
Controls the ability of WMC to collect and send analytics data.
Guidelines and Restrictions
- When used, this method must be called before calling the createPlayer (p. 94) method.
Parameters:
Name |
Type |
Description |
analyticsEnabled |
boolean
|
Enables or disables the analytics function as follows:
- true - Analytics enabled.
- false - Analytics disabled.
|
Returns:
- true - Set successful.
- false - Set failed.
-
Type
-
boolean
#
setAudio(audioTrackId) → {boolean}
Changes the currently playing audio track to the specified track.
Guidelines and Restrictions
- To retrieve a list of available audio tracks, use the setAudio (p. 86) method.
- See also Using the Alternate Audio Feature (p. 40).
Parameters:
Name |
Type |
Description |
audioTrackId |
string
|
Audio track identifier, which consists of the following attributes:
- “Audio” - Fixed string: Audio
- PID - Numeric ID, usually 3 numbers long. If none exists, use UND.
- Codec - Codec identifier (for example, AC3). The length is unimportant. If none exists, use UND.
- Language Code - Language character code, which is usually two or three characters, such as en, swe, dan, or fin. If none exists, use UND.
|
Example
setAudio(' Audio-UND-AAC-en')
#
setBandwidth(value) → {boolean}
Sets the current quality for media type instead of letting the ABR Heuristics automatically selecting it.
Guidelines and Restrictions
- This method is for use with the DASH player only.
- This function can be called any time after MRR-CC is created.
- (Safari browser only) The Safari web browser on an Apple Mac desktop does not support this method.
Parameters:
Name |
Type |
Description |
value |
number
|
specifies the minimum bandwidth allowed in kilobits per second (kbps) |
#
setBeaconFailOpenConfig(enableBeaconFailover, duration, initDelta, finalDelta)
Set beacon backoff. This function can be called anytime after MRR-CC is created.
Parameters:
Name |
Type |
Description |
enableBeaconFailover |
boolean
|
specifies the status of beacon failover |
duration |
number
|
max backoff duration in minutes or 0 for no limit (in minutes) |
initDelta |
number
|
constant duration in minutes (in minutes) |
finalDelta |
number
|
max variable duration in minutes (in minutes) |
#
setBookmark(mediaUid, time)
Sets the bookmark position (in seconds) for a specific media unique identifier (UID).
Guidelines and Restrictions
- This method works in IMC_MODE_ADAPTIVE mode only (see createPlayer (p. 94)).
- This method can be called any time after the init (p. 81) method.
Parameters:
Name |
Type |
Description |
mediaUid |
string
|
specifies the UID of the media. |
time |
number
|
bookmark position (in seconds) to be set. |
#
setBookmarkEnabled(bookmarkEnabled) → {boolean}
Controls the ability of WMC to save bookmarks locally on the device.
Guidelines and Restrictions
- When used, this method must be called before calling the init (p. 81) method.
Parameters:
Name |
Type |
Description |
bookmarkEnabled |
boolean
|
controls the ability of the WMC to save bookmarks locally on the device as follows:
true – Bookmarks are saved locally.
false – Bookmarks are not saved locally. (default setting)
- It is optional but if needed, it must be called before calling the init() function.
|
Returns:
- true - Set Successful
- false - Set Failed
-
Type
-
boolean
#
setBufferLevel(value) → {boolean}
Set the player target buffer level in sec
Parameters:
Name |
Type |
Description |
value |
object
|
should be positive integer or 0 |
Example
{"video":{"forwardDuration":0,"backwardDuration":0},"audio":{"forwardDuration":0,"backwardDuration":0}}
#
setCDNFailoverPercent(value) → {boolean}
Set the cdn failover percent between 0 to 100
Parameters:
Name |
Type |
Description |
value |
number
|
should be positive integer or 0 |
#
setCdnProfile(cdnProfile) → {boolean}
Set the name of CDN profile. It is optional but if needed, it must be called before calling the init() function.
Guidelines and Restrictions
- When used, this method must be called before calling the init method.
Parameters:
Name |
Type |
Description |
cdnProfile |
string
|
specifies the CDN profile name. |
#
setCDNToken(token) → {boolean}
Set token for CDN url, which will be append duing manifest call
Parameters:
Name |
Type |
Description |
token |
object
|
should be an json key value object |
Example
{ "token1": "value1", "token2": "value2" }
#
setCdnUrl(cdnUrl) → {boolean}
Guidelines and Restrictions
- When used, this method must be called before calling the init (p. 81) method.
- The URL must include http:// or https://.
- Avoid using the underscore (_) character in the URL as some host systems, such as Apache Lynx, do not support this character.
Set the base CDN URL to be used to construct the segment URLs by WMC if the client application uses its own CDN; otherwise, it is set to be NULL.
Parameters:
Name |
Type |
Description |
cdnUrl |
string
|
Base CDN URL |
#
setContainer(mainContainer, subtitleContainer)
Set an HTML5 HTMLMediaElement for WMC to render the media. This must be called before start() and after MRR-CC is created.
Guidelines and Restrictions
- This method must be called after the AmcManager (p. 71) object is created and before the start (p. 95) method.
- The HTMLMediaElement must already be defined in the Document Object Model (DOM).
- The subtitleContainer parameter is only required when using subtitles with the DASH player.
Parameters:
Name |
Type |
Description |
mainContainer |
object
|
an HTMLMediaElement that has already been defined in the DOM |
subtitleContainer |
object
|
an HTMLMediaElement that has already been defined in the DOM |
#
setDefaultInHomeStatus(status)
Set default status for inHome or outHome
Parameters:
Name |
Type |
Description |
status |
AZUKI_HOME_STATUS_T
|
set status of inHome detection server
AZUKI_HOME_STATUS_T.AZUKI_HOME_STATUS_IN: 0
AZUKI_HOME_STATUS_T.AZUKI_HOME_STATUS_OUT: 1 |
#
setDeviceId(deviceId) → {boolean}
Set the device Id for user account. It is optional but if needed, it must be called before calling during manifest call.
Guidelines and Restrictions
- When used, this method must be called before calling the manifest url (p. 81) method.
Parameters:
Name |
Type |
Description |
deviceId |
string
|
specifies the primary user device id. |
#
setDvrFromRollingBuffer(dvrFromRollingBuffer) → {boolean}
Set the rolling buffer to true or false, which is used by ACC to differentiate whether playback is for DVR or NOT
Parameters:
Name |
Type |
Description |
dvrFromRollingBuffer |
boolean
|
|
#
setEncSeed(encSeed) → {boolean}
Sets the owner-specific encrypted seed for DRM. The seed is encrypted with Whitebox AES, from which a shared secret is generated for encrypting messages between WMC and the MRR- CC. A MediaKind proprietary software package is used to generate a pair of encrypted seeds in which one seed is specifically marked as for use on the MRR-CC (backend server) and the other seed is marked for use on WMC (client).
Guidelines and Restrictions
- When used, this method must be called before calling the init (p. 81) method.
- This feature is for use by MediaKind only
Parameters:
Name |
Type |
Description |
encSeed |
string
|
Owner-specific encrypted seed integer |
#
setExternalSourceParams(externalSourceParams) → {boolean}
Set the external source parameters
Parameters:
Name |
Type |
Description |
externalSourceParams |
object
|
the external source parameters |
Returns:
true on success, false otherwise
-
Type
-
boolean
#
setGeofenceWithRadius(radius) → {object}
To set Geofences
Parameters:
Name |
Type |
Description |
radius |
number
|
|
#
setInHomeDetectionServiceURL(url, endpoint) → {boolean}
Sets the third-party product (3PP) in-home detection service URL.
Guidelines and Restrictions
- This method requires MRR-MP 4.5.0.x or later on the backend.
Parameters:
Name |
Type |
Description |
url |
string
|
Base 3PP in-home detection service URL to be used to construct the v3 InHome3pp call; otherwise, it is set to be NULL. |
endpoint |
string
|
Endpoint of inHome detection server |
Returns:
- true - Set successful.
- false - Set failed.
-
Type
-
boolean
#
setInHomeStatus(status)
Set the inHome status
Parameters:
Name |
Type |
Description |
status |
AZUKI_HOME_STATUS_T
|
status of inHome detection serve. |
#
setInHomeToken(token) → {boolean}
Sets the authentication in-home token that is required to access a third-party product (3PP) in-home detection service.
Guidelines and Restrictions
- This method requires MRR-MP 4.5.0.x or later on the backend.
Parameters:
Name |
Type |
Description |
token |
string
|
access token of inHome detection server |
Returns:
- true - Set successful.
- false - Set failed.
-
Type
-
boolean
#
setLocationEnabled(locationEnabled)
Controls if geolocation is enabled
Parameters:
Name |
Type |
Description |
locationEnabled |
boolean
|
controls the ability of the WMC to enable geolocation feature
true – Enable geolocation.
false – disable geolocation. (default setting)
It is optional but if needed, it must be called before calling the init() function. |
#
setLogLevel(level)
specifies the log level. The WMC supports the following log levels:
IMC_LOG_NONE: 0,
IMC_LOG_ERROR: 1, (default setting)
IMC_LOG_INFO: 2,
IMC_LOG_WARN: 3,
IMC_LOG_DEBUG: 4
See also AmcConstants for the log Level constants.
Parameters:
Name |
Type |
Description |
level |
number
|
|
#
setLowLatency(value) → {boolean}
To set LLC
Parameters:
Name |
Type |
Description |
value |
number
|
|
#
setManifestRetryCount(value) → {object}
Set the total number of retry attempts for manifest,
that will occur on a manifest load before it fails
Set the total number of retry attempts,
that will occur on a manifest load before it fails.
Parameters:
Name |
Type |
Description |
value |
number
|
|
#
setManifestRetryInterval(value) → {object}
Set the interval of manifest retry attempts for manifest,
that will occur on a manifest load before it fails
Set the interval of manifest retry attempts in millisecond format,
that will occur on a manifest load before it fails.
Parameters:
Name |
Type |
Description |
value |
number
|
|
#
setMaxBandwidth(maxBandwidth) → {boolean}
Sets the maximum bandwidth limit allowed for downloading the video content from a CDN. Specified in (kilobits per second (kbps).
Guidelines and Restrictions
- This method can be called any time after AmcManager (p.71) is created.
- When used, this method can be called any time during playback.
- A value that is less than or equal to zero (0) means that there is no upper bandwidth limit and an ABR auto-switch algorithm is used to select the optimal upper bandwidth.
- (Safari browser only) The Safari web browser on an Apple Mac desktop does not support this method.
Parameters:
Name |
Type |
Description |
maxBandwidth |
number
|
specifies the maximum bandwidth limit in kilobits per second (kbps)
- for downloading the video content from a CDN. A value that is less than or equal to 0 means that
- there is no upper bandwidth limit.
|
#
setMinBandwidth(minBandwidth) → {boolean}
Sets the minimum bandwidth limit allowed for downloading the video content from a CDN. Specified in (kilobits per second (kbps).
Guidelines and Restrictions
- This method can be called any time after AmcManager (p.71) is created.
- When used, this method can be called any time during playback.
- A value that is less than or equal to zero (0) means that there is no lower bandwidth limit and an ABR auto-switch algorithm is used to select the optimal bandwidth.
- If you set this property to a value that is higher than the current playback bandwidth, WMC switches to the higher requirement. If you set this property to a value that is lower than the lowest bitrate as specified in the owner profile on MRR-MP, WMC plays the video at the lowest bitrate specified in the owner profile.
- (Safari browser only) The Safari web browser on an Apple Mac desktop does not support this method.
Parameters:
Name |
Type |
Description |
minBandwidth |
number
|
specifies the minimum bandwidth allowed in kilobits per second (kbps)
- for downloading the video content from a CDN. If you set this property to a value higher than that currently playing, the switching engine will switch up to
- satisfy this requirement. If you set it to a value that is lower than the lowest bitrate, it will still play that lowest bitrate.
|
#
setMute(value)
Set Audio mute.
Parameters:
Name |
Type |
Description |
value |
boolean
|
specifies the volume of the player.
- boolean value within true to false
|
#
setOffset(time, timelineReference) → {bool}
Set the player startoffset time during player initialization.
Parameters:
Name |
Type |
Description |
time |
number
|
- pass positive or negative integer
|
timelineReference |
string
|
- pass 'start' will be calculated from the beginning of the stream or DVR window
- pass 'end' will be calculated from the end of the stream or the live edge in case of a live stream with DVR window
- pass 'absolute' will automatically seek to the specified utc time for live event playback, once playback starts
|
Example
// Start a VOD stream at 10.5 seconds
{
time: 10.5,
timelineReference: "start" // also the default value
}
// Start a LIVE stream 20 seconds behind the live edge
{
time: -20,
timelineReference: "end" // also the default value
}
// Seek to 1234567890 once playback of live event starts
{
time: 1234567890,
timelineReference: "absolute"
}
#
setPlayerKey(playerKey) → {boolean}
Set the player license key.
Use this function to set the unique player license key on the player.
Parameters:
Name |
Type |
Description |
playerKey |
string
|
the unique player license key |
Returns:
true on success, false otherwise
-
Type
-
boolean
Example
wmcMgr.setPlayerKey("***************");
#
setPlaySpeed(rate)
To set current playback rate.
Description: Indicates the current playback speed of the audio/ video.
Parameters:
Name |
Type |
Description |
rate |
number
|
The playbackRate property sets the current playback speed of the audio/video. |
Example
PlayRate values:
1.0 is normal speed
0.5 is half speed (slower)
2.0 is double speed (faster)
-1.0 is backwards, normal speed
-0.5 is backwards, half speed
#
setPreferredAudio(preferredAudio)
Sets the following preferences for the initial audio track selection: preferredAudio, UIAudio, and audioCodec. Using a precedence algorithm, WMC attempts to pick one of the available audio tracks based on the specified preferences as follows:
- If language and UI language are specified, language takes precedence.
- If more than one track matches the specified language or UI language, the codec is used to determine which audio to use.
- If a match cannot be found, the default audio track is played.
Guidelines and Restrictions
- When used, this method must be called before calling the init (p. 81) method.
- See also Using the Alternate Audio Feature (p. 40).
Parameters:
Name |
Type |
Description |
preferredAudio |
object
|
Audio track with the following attributes:
- preferredAudio - (String) Language
- UIAudio - (String) UI language
- audioCodec - (String) Audio codec
|
Example
setPreferredAudio({ preferredAudio: 'en', UIAudio: 'fr', audioCodec: 'AAC' })
#
setPrimary(primary) → {boolean}
Set the primary user account. It is optional but if needed, it must be called before calling the init() function.
Guidelines and Restrictions
- When used, this method must be called before calling the init (p. 81) method.
Parameters:
Name |
Type |
Description |
primary |
string
|
specifies the primary user account. |
#
setRestartThreshold(time) → {bool}
Set the player restart threshold during player initialization.
Parameters:
Name |
Type |
Description |
time |
number
|
|
#
setStartBandwidth(startBandwidth) → {boolean}
Set the playback start bandwidth in kilobits per second (kbps).
Guidelines and Restrictions
- This method must be called before calling the init (p. 81) method.
- If you do not set the start bandwidth, the default start bandwidth algorithm is used.
- The value must be greater than zero (0). A negative or zero value is ignored.
- (Safari browser only) The Safari web browser on an Apple Mac desktop does not support this method.
Parameters:
Name |
Type |
Description |
startBandwidth |
number
|
specifies the start bandwidth for the playback in kilobits per second (kbps).
- The value must be greater than zero. A negative or zero value is ignored.
- If it is not set, the default start bandwidth algorithm is used.
- It is optional but if needed, it must be called before calling the init() function.
|
#
setStartOffset(startOffset)
To set Offset value
Parameters:
Name |
Type |
Description |
startOffset |
boolean
|
|
#
setStartTime(time)
To set Plyaback Start Time
Parameters:
Name |
Type |
Description |
time |
string
|
|
#
setStartupThreshold(time) → {bool}
Set the player startup threshold during player initialization.
Parameters:
Name |
Type |
Description |
time |
number
|
|
#
setStartupVolumeConfig(volumeLevelopt, mutedopt)
The volume config parameters to be set on the player on playback start
Parameters:
Name |
Type |
Attributes |
Description |
volumeLevel |
number
|
<optional>
|
in the range 0 and 1, Ex: 0.4, 0.7, 0 or 1 |
muted |
boolean
|
<optional>
|
true when volume is to be muted, false when unmuted |
#
setSTSToken(token)
To set STS Token
Guidelines:
- ChromeCast Playback
- SDK WMC-RefApp Playback
Parameters:
Name |
Type |
Description |
token |
string
|
|
#
setSubtitle(lang)
Sets a new subtitle language for IMC_MODE_ADAPTIVE and IMC_MODE_LIVE modes (see createPlayer (p. 94)).
Guidelines and Restrictions
- To see a list of available subtitles, see getSubtitles. (p. 93).
- The setSubtitle value can be changed at any time after the client app receives the AMC_EVENT_TEXT_TRACKS_ADDED delegate callback from WMC (see AmcEvents (p. 107)). If the method is called prior to receiving this callback, WMC ignores it.
- The subtitle feature requires the following items depending on player type:
-
- Dash player - Requires the following:
--- VSPP 4.3.2 or later
--- TTML format (VSPP default format for DASH)
--- UTF-8 encoding
-
- HLS player - Requires the following:
--- VTT format (VSPP default format for HLS)
--- VSPP default encoding
- This method requires MRR-MP software version 4.1.0.0 or later.
Parameters:
Name |
Type |
Description |
lang |
string
|
New subtitle. Set subtitle to null to turn off subtitles. |
#
setSubtitleState(enable)
Set the subtitle state.
Parameters:
Name |
Type |
Description |
enable |
boolean
|
enable or disable subtitles |
#
setTenantId(tenantId) → {boolean}
Set the tenant id. It is optional but if needed, it must be called before calling the init() function. This api is not required for MKP service.
Guidelines and Restrictions
- When used, this method must be called before calling the init (p. 81) method.
Parameters:
Name |
Type |
Description |
tenantId |
string
|
specifies the tenantId |
#
setTimeShiftMode(timeShiftMode)
To set TimeShiftMode as true/false.
Parameters:
Name |
Type |
Description |
timeShiftMode |
boolean
|
- True: get dvr info start time
- False: get current time in utc
|
Set the transcode format. It is optional but if needed, it must be called before calling the init() function.
Guidelines and Restrictions
- This method is not supported at this time.
- When used, this method must be called before calling the init (p. 81) method.
Parameters:
Name |
Type |
Description |
transcodeFormat |
string
|
specifies the transcode format. |
#
setUserProfile(profileName) → {boolean}
Set the profile name for user account. It is optional but if needed, it must be called before calling during manifest call.
Guidelines and Restrictions
- When used, this method must be called before calling the manifest url (p. 81) method.
Parameters:
Name |
Type |
Description |
profileName |
string
|
specifies the primary user profile name. |
#
setVideoQuality(videoQualityId)
Set the player playback video quality.
Parameters:
Name |
Type |
Description |
videoQualityId |
string
|
The quality id. |
#
setVolume(value)
Set the volume.
Parameters:
Name |
Type |
Description |
value |
number
|
specifies the volume of the player.
- decimal value within 0 to 1
|
#
start()
Instructs WMC to start video playback.
Guidelines and Restrictions
- The app must call this function only after it receives the AMC_EVENT_PLAY_READY callback (see AmcEvents (p. 107)).
- To see how this method is used, see Playback Complete (p. 26).
- Deprecated:
- preloadAndWait - optional parameter
#
stop()
Instructs WMC to stop video playback.
Guidelines and Restrictions
- To see how this method is used, see Playback Stop (p. 27)
#
timeshiftEnabled() → {boolean}
Provides the app with the status of the requested media's timeshifting capabilities as follows:
- True - Timeshifting is enabled, which means that the following functionality is available with the media:
-- Catchup TV - User can view previously played live video.
-- Live Scrub - User can use the rewind, pause, resume, seek, and fast forward functions on live video.
Note: Currently, only seek, pause, and resume are supported.
- False - Timeshifting is not enabled, which means that the user can view the live media but cannot perform any of the timeshifting functions.
Getting status of a media if it is time-shifted or not