Type: namespace
- Functions:
Type: global class
- Player
- Instance
- .attachSubtitleRendererDiv(subtitleRendererDiv)
- .checkFrameDrop() ⇒ number
- .clickFocus()
- .create360View()
- .disableABR()
- .enableABR()
- .enablePreviewThumbnails(option)
- .enterPictureInPicture()
- .exitPictureInPicture()
- .FairPlayNexLicenseRequestFailed(event)
- .FairPlayNexLicenseRequestLoaded(event)
- .getAudioStreams() ⇒ Array.< AudioStream >
- .getConfig()
- .getBufferLength() ⇒ number
- .getCurrentAudioStream() ⇒ AudioStream
- .getCurrentBuffer()
- .getCurrentLiveLatency()
- .getCurrentLiveTime() ⇒ number
- .getCurrentSubtitle()
- .getCurrentTime() ⇒ number
- .getCurrentTrack() ⇒ Track
- .getDuration() ⇒ number
- .getDVRWindowSize() ⇒ number
- .getManifestInfo()
- .getPlaybackSpeed()
- .getProtocol() ⇒ number
- .getQualityLevels() ⇒ array
- .getStreamType()
- .getSubtitles()
- .getThumbnailAt(number)
- .getThumbnailController() ⇒ ThumbController
- .getTimeShiftBufferDepth() ⇒ number
- .getTimeUntilLive() ⇒ number
- .getTracks() ⇒ Array.< Track >
- .getURL()
- .getVersion()
- .hasEnded()
- .hiddenVolumeIcon()
- .isAd()
- .isControlBarOpen()
- .isFullScreen()
- .isLive() ⇒ boolean
- .isPaused()
- .isPictureInPicture()
- .isPictureInPictureAvailable()
- .isPlaying()
- .isReady()
- .isUTC() ⇒ boolean
- .jumpBackward(value)
- .jumpForward(value)
- .loadSource(url)
- .nextFocus()
- .on(callbackType, functionToBeCalled)
- .previousFocus()
- .seek(value)
- .seekLive()
- .setAudioStream(streamID)
- .setCurrentTrack(trackID)
- .setSpeed(speed)
- .setSubtitle(subID)
- .setThumbnailResources(callback, vttURl, imageURL)
- .setThumbnailStep(step)
- .showStats()
- .showVolumeIcon()
- .toggleBar()
- .toggleControlBar()
- .toggleFullScreen()
- .toggleLanguagesMenu()
- .togglePlayPause()
- Ads
- .adManager()
- .abort()
- .addBlockedListener(func)
- .addClickListener(func)
- .addCompleteListener(func)
- .addErrorListener(func)
- .addFirstQuartileListener(func)
- .addImpressionListener(func)
- .addMidpointListener(func)
- .addPausedListener(func)
- .addResumedListener(func)
- .addSkippedListener(func)
- .addStartedListener(func)
- .addThirdQuartileListener(func)
- .addVolumeChangedListener(func)
- .addVolumeMutedListener(func)
- .destroy()
- .discardAdBreak()
- .focus()
- .getAdObject()
- .getAdSkippableState()
- .getAdSystem()
- .getAdvertiserName()
- .getApiFramework()
- .getContentType()
- .getCreativeAdId()
- .getCreativeId()
- .getCuePoints()
- .getCurrentTime()
- .getDealId()
- .getDescription()
- .getDuration()
- .getHeight
- .getId()
- .getMediaUrl()
- .getMinSuggestedDuration()
- .getRemainingTime()
- .getSkipTime()
- .getSurveyURL()
- .getTitle()
- .getTraffickingParameters()
- .getTraffickingParametersString()
- .getUiElements()
- .getUniversalAdIdRegistry()
- .getUniversalAdIds()
- .getUniversalAdIdValue()
- .getVastMediaBitrate()
- .getVastMediaHeight()
- .getVastMediaWidth()
- .getVolume()
- .getWidth()
- .getWrapperAdIds()
- .getWrapperAdSystems()
- .getWrapperCreativeIds()
- .init(width, height, viewMode, videoElement)
- .isCustomPlaybackUsed()
- .isLinear()
- .isSkippable()
- .isVpaid()
- .pause()
- .play()
- .resize
- .setVolume()
- .skip()
- Static
- NexEvent: enum
- NexProtocol: enum
- THUMB_TYPE: enum
- Global Typedefs
- AudioStream : object
- Frame : object
- NexCallback : object
- NexCallbackEvent : object
- NexDRMInformation : object
- NexHeaders : object
- Track : object
- VR Player
- Multiview
- YouTubePlayer
Creates and initializes the player.
Type: function of nexplayer
Param:
- configuration is an object which its properties values could be:
Mandatory Parameters:
Param | Type | Description |
---|---|---|
key | string |
NexPlayer key to validate the playback. |
div | HTMLDivElement |
Div container of the player. |
src | string |
Relevant src of the video to be played. |
Optional Parameters:
Param | Type | Description |
---|---|---|
allowScreenPlayPause | boolean |
Allows to play and pause the video clicking on it. |
autohide | boolean |
Sets if the UI must hide when the user does not interact with the video. True by default. |
autoplay | boolean |
Determines if the video must start playing or paused. True by default. |
blockZoom | boolean |
Determines if the zoom in 360 videos is available or not. |
callbackForLogger | Function |
Function to be called when the logger shows a message. |
callbackForReturn | Function |
Sets a callback checkSupportedConfigurations(URL, DRMType) to be executed when the corresponding button is clicked. |
callbacksForPlayer | Function |
Used for retrieving the nexplayer instance and video element. This is necessary for getting the instance and use the NexPlayer API. |
cast | boolean |
Determines if the cast will be enabled or not. |
chromecastEndImg | string |
URL of an image to be used as ending. |
chromecastLaunchImg | string |
URL of an image to be used at launch. |
debug | boolean |
Determines if log information is showed. By default is set to true. |
defaultQuality | number |
Sets the starting track through its id. By default is -1, this enables the ABR. |
disableFullscreen | boolean |
Determines if the full screen will be enabled. |
disableKeyEvents | boolean |
Determines if the keyboard keys can be used to control the video (play/pause, forward/backward and volume up/down). |
drm | Array<NexDRMInformation> |
Contains an array of DRM information. By default it's set to null. |
externSubtitles | Array |
Used to provide subtitle files as external subtitles. |
hideOptionsUi | Object |
Hides the setting that you choose from the UI. |
hideScreenPlay | boolean |
Hides the play button in the middle of the video, which appears when the video is paused. |
hideVolumeIcon | boolean |
Determines if the volume icon will be hidden for mobile devices. The volume is controlled by the device buttons. |
lowLatency | boolean |
Determines if the low latency will be enabled. |
liveSettings | Object |
Settings to control live playback. Requires low latency. |
logosrc | string |
Company URL logo. |
mutedAtStart | boolean |
Determines if the video will start playing muted or not. By default this value is set to false. |
pip | boolean |
Determines if picture-in-picture will be enabled. |
poster | string |
Video poster URL. |
seekUI | number |
Sets the number of seconds the UI buttons will seek forwards or backwards. Set to 10s by default. |
showingFullUI | boolean |
Determines if the UI is hidden or not. |
showUI360 | boolean |
Determines if the 360UI will be enabled. |
srcSets | Array |
Array of objects that contains a stream and an optional DRM. |
staticThumbnailsImage | string |
Image to extract thumbnails from. |
staticThumbnailsVTT | string |
Used to provide the player an external thumbnails VTT file. |
startingBufferLength | number |
Determines the buffer that the video should have before start. |
startFullscreen | boolean |
Determines if the video will start on full screen. |
subtitle | string |
Video subtitle name. |
timeUI | boolean |
Determines if the video time will be hidden on the UI. |
title | string |
Video name. |
type_360 | string |
Selects the 360 video format to play. Possible values are 'equirectangular', 'cubemap' and 'topdown'. |
useDynamicThumbnails | boolean |
Determines if dynamic thumbnails are used. By default this value is set to false. |
useiOSFullScreen | boolean |
Determines if the iOS native full screen will be used. |
vast | string |
Advertisement URL that is going to be played. VAST, VPAID and VMAP are supported. |
watermark | Object |
Watermark image URL. |
withCredentials | boolean |
Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates. |
cmcd | Object |
Enables the Common Media Client Data. Only needs to create an empty object to enable it. |
licenseWithCredentials | boolean |
Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates with DRM. |
maxFrameDrop | number |
The value of this property should be within the range 0 - 1. A Frames_Drop_Capping event will be triggered whenever the percentage of frames dropped is higher than this threshold. |
xhrSetHeader | Array |
You can configure the headers that are necessary for the URL request. |
Check if the audio and video codecs and DRMType, if it is provided, are supported by the device.
Type: function of nexplayer
Params:
- URL: manifest URL of the video.
- DRMType: optional type of DRM (e.g., "com.microsoft.playready" ) Returns: A Promise. If it is resolved returns a MediaKeySystemAccess object with the supported codecs, and if it is rejected returns a string with the error.
Reloads the player with the given configuration. If the configuration object is not provided the previous one will be used. If it is provided the properties passed will override the values of the previous configuration object.
Type: function of nexplayer
Param:
- configuration is an object which its properties values could be:
Mandatory Parameters:
Param | Type | Description |
---|---|---|
key | string |
NexPlayer key to validate the playback. |
div | HTMLDivElement |
Div container of the player. |
src | string |
Relevant src of the video to be played. |
Optional Parameters:
Param | Type | Description |
---|---|---|
allowScreenPlayPause | boolean |
Allows to play and pause the video clicking on it. |
autohide | boolean |
Sets if the UI must hide when the user does not interact with the video. True by default. |
autoplay | boolean |
Determines if the video must start playing or paused. True by default. |
blockZoom | boolean |
Determines if the zoom in 360 videos is available or not. |
callbackForLogger | Function |
Function to be called when the logger shows a message. |
callbackForReturn | Function |
Sets a callback checkSupportedConfigurations(URL, DRMType) to be executed when the corresponding button is clicked. |
callbacksForPlayer | Function |
Used for retrieving the nexplayer instance and video element. This is necessary for getting the instance and use the NexPlayer API. |
cast | boolean |
Determines if the cast will be enabled or not. |
chromecastEndImg | string |
URL of an image to be used as ending. |
chromecastLaunchImg | string |
URL of an image to be used at launch. |
debug | boolean |
Determines if log information is showed. By default is set to true. |
defaultQuality | number |
Sets the starting track through its id. By default is -1, this enables the ABR. |
disableFullscreen | boolean |
Determines if the full screen will be enabled. |
disableKeyEvents | boolean |
Determines if the keyboard keys can be used to control the video (play/pause, forward/backward and volume up/down). |
drm | Array<NexDRMInformation> |
Contains an array of DRM information. By default it's set to null. |
externSubtitles | Array |
Used to provide subtitle files as external subtitles. |
hideOptionsUi | Object |
Hides the setting that you choose from the UI. |
hideScreenPlay | boolean |
Hides the play button in the middle of the video, which appears when the video is paused. |
hideVolumeIcon | boolean |
Determines if the volume icon will be hidden for mobile devices. The volume is controlled by the device buttons. |
lowLatency | boolean |
Determines if the low latency will be enabled. |
liveSettings | Object |
Settings to control live playback. Requires low latency. |
logosrc | string |
Company URL logo. |
mutedAtStart | boolean |
Determines if the video will start playing muted or not. By default this value is set to false. |
pip | boolean |
Determines if picture-in-picture will be enabled. |
poster | string |
Video poster URL. |
seekUI | number |
Sets the number of seconds the UI buttons will seek forwards or backwards. Set to 10s by default. |
showingFullUI | boolean |
Determines if the UI is hidden or not. |
showUI360 | boolean |
Determines if the 360UI will be enabled. |
srcSets | Array |
Array of objects that contains a stream and an optional DRM. |
staticThumbnailsImage | string |
Image to extract thumbnails from. |
staticThumbnailsVTT | string |
Used to provide the player an external thumbnails VTT file. |
startingBufferLength | number |
Determines the buffer that the video should have before start. |
startFullscreen | boolean |
Determines if the video will start on full screen. |
subtitle | string |
Video subtitle name. |
timeUI | boolean |
Determines if the video time will be hidden on the UI. |
title | string |
Video name. |
type_360 | string |
Selects the 360 video format to play. Possible values are 'equirectangular', 'cubemap' and 'topdown'. |
useDynamicThumbnails | boolean |
Determines if dynamic thumbnails are used. By default this value is set to false. |
useiOSFullScreen | boolean |
Determines if the iOS native full screen will be used. |
vast | string |
Advertisement URL that is going to be played. VAST, VPAID and VMAP are supported. |
watermark | object |
Watermark image URL. |
withCredentials | boolean |
Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates. |
cmcd | Object |
Enables the Common Media Client Data. Only needs to create an empty object to enable it. |
licenseWithCredentials | boolean |
Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates with DRM. |
maxFrameDrop | number |
The value of this property should be within the range 0 - 1. A Frames_Drop_Capping event will be triggered whenever the percentage of frames dropped is higher than this threshold. |
xhrSetHeader | Array |
You can configure the headers that are necessary for the URL request. |
Decodes an ArrayBuffer and converts it into a string. END OF TEXT (\u0003) and NULL (\u0000) unicode characters are cleaned.
Type: function of nexplayer
Param:
- data is the ArrayBuffer to decode.
Returns: decoded and cleaned string or null if the parameter provided is not an ArrayBuffer.
Gets all of the videoes avaliable tracks (different qualities).
Type: instance method of Player
Returns: Array.< Track > - all the tracks available.
Get the current track information.
Type: instance method of Player
Returns: Track - the current track.
Sets the current track.
Type: instance method of Player
Export:
Param | Type | Description |
---|---|---|
trackID | number |
ID of the track to be used. |
Enables the ABR to change automatically between tracks.
Type: instance method of Player
Disables the ABR to prevent the player from changing tracks regardless of bandwidth.
Type: instance method of Player
Get the available audio streams.
Type: instance method of Player
Returns: An array - which contains the available audio streams.
Get the audio stream currently in use.
Type: instance method of Player
Returns: AudioStream - the current audio track.
Sets the current audio stream.
Type: instance method of Player
Export:
Param | Type | Description |
---|---|---|
streamID | number |
ID of the audio stream to be used. |
Gets the current subtitle info.
Type: instance method of Player
Returns: Current Subtitle - the current subtitle track (undefined if no subtitles are activated).
Gets all the avaliable subtitle tracks info.
Type: instance method of Player
Returns: Array of subtitles - the subtitle tracks of the video.
Sets the current subtitle track.
Type: instance method of Player
Export:
Param | Type | Description |
---|---|---|
subID | number |
ID of the subtitle track to be used |
Informs whether the video is live or on demand (VOD). This needs to be called when the manifest is finally loaded. It is recommended to use within the video "loadeddata" event.
Type: instance method of Player
Returns: boolean - true if the video is live, otherwise it returns false.
Adds a listener for Events.
Type: instance method of Player
Export:
Param | Type | Description |
---|---|---|
callbackType | NexEvent |
Event to listen for |
functionToBeCalled | NexCallbackEvent |
Function called on each event |
Adds a DIV to render certain subtitles in a more precise way. This is optional and the native subtitles of the video element will be used if this is not set.
Type: instance method of Player
Export:
Param | Type | Description |
---|---|---|
subtilteRendererDiv | SubtitleRendererDiv |
DIV to render some advanced subtitles |
Creates the 360 view.
Type: instance method of Player
Called when the FairPlay request is done.
Type: instance method of Player
Export:
Param | Description |
---|---|
event | Event |
Called if the FairPlay request fails.
Type: instance method of Player
Export:
Param | Description |
---|---|
event | Event |
Sets thumbnail resources. This method should be called before Init().
Type: instance method of Player
Export:
Param | Type | Description |
---|---|---|
callback | NexCallbackEvent |
function called when the thumbnails are loaded |
vttURl | String |
path to the .vtt thumbnails file |
imageURL | String |
path to the thumbnails image file |
Indicates whether the video information (currentTime, duration, seekable range, etc.) of the video element is based on the present or on an absolute value that starts at midnight UTC, Jan 1, 1970. If this is true, you will need to take this into account when seeking through the currentTime of the video element. Some useful methods (like getCurrentTime, getDuration, and seek) are available to reduce the complexity in these cases. Note that this property only applies to live streams.
Type: instance method of Player
Returns: boolean - true if the video information is using UTC, false otherwise.
Returns the currentTime taking into account isUTC (if isUTC is true, getCurrentTime's returned value will be different from the time of the video element).
Type: instance method of Player
Returns: number - the current time of the video.
Returns the duration taking into account isUTC (if isUTC is true, getDuration's returned value will be different from the duration of the video element).
Type: instance method of Player
Returns: number - the duration of the video.
Returns the window of allowable play time behind the live point of a live stream, this value will increase until the buffer is full, with the full content, at that point of time, the value will be constant.
Type: instance method of Player
Returns: number - the window of allowable play time behind the live point of a live stream.
Returns the current video URL.
Type: instance method of Player
Returns: String
Returns the number of dropped frames as proxy for CPU load
Type: instance method of Player
Returns: number - number of dropped frames.
Sets the currentTime property of the attached video element. (if isUTC is true, the seek value will be in a different format than the currentTime of the video element).
Type: instance method of Player
Param | Type | Description |
---|---|---|
event | Event | value in seconds that the player will seek to. |
//Non-live video
player.seek(120) // This will seek forward 120 seconds (2:00 minutes), must be a positive number ranging from 0 to the full duration of the video in seconds
//Live video
player.seek(-120) // It jumps back 120 seconds (2:00 minutes) from the current live time, must be a negative number ranging from minus {the DVR window size} to 0
Jump to the livestream current time from the current position (if isUTC is true, the seek value will be in a different format than the currentTime of the video element). Only works on livestreams.
Type: instance method of Player
Returns the seconds of buffer loaded that the player has available to play.
Type: instance method of Player
Returns: number - time of buffer length
Returns the time in which the livestream is at.
Type: instance method of Player
Returns: number - time in which the livestream is at.
Returns the time difference between the current video time and the livestream time.
Type: instance method of Player
Returns: number - time difference between the time it's currently found in and the time the livestream is at.
Returns some information about the manifest.
Type: instance method of Player
Returns: number - some information about the manifest.
Returns the time shift buffer depth in seconds, this function only works in live streams.
Type: instance method of Player
Returns: number - time shift buffer depth
Returns the protocol type.
Type: instance method of Player
Returns: number - the protocol type.
Returns the preview thumbnail controller.
Type: instance method of Player
Returns: ThumbController - Thumbnail controller
Sets the time interval between frames for dynamic thumbnails.
Type: instance method of Player
Param | Type | Description |
---|---|---|
step | number | The seconds between two different thumbnails. |
Enable thumbnails preview. This method must be called before Init().
Type: instance method of Player
Param | Type | Description |
---|---|---|
option | boolean | The value that enable or not the thumbnails. |
Set the video playback speed.
Type: instance method of Player
Param | Type | Description |
---|---|---|
speed | number | The speed value. |
#### player.getQualityLevels() ⇒ array
Get the video quality levels array.
Type: instance method of Player
Returns: array - quality levels array info
Plays or pauses the playback.
Type: instance method of Player
Toggles between full screen or window mode.
Type: instance method of Player
Displays basic stream information when typing "nex" on the keyboard.
Type: instance method of Player
Jumps forward to the current playback position of the player.
Type: instance method of Player
Param: {number} value is the number of seconds to jump forward
Jumps backward to the current playback position of the player.
Type: instance method of Player
Param: {number} value is the number of seconds to jump backward
Sets the step for dynamic thumbnails.
Type: instance method of Player
Param: {number} step is the seconds between two different thumbnails
Returns the live latency value.
Type: instance method of Player
Returns: latency number of seconds
Returns the current buffer level.
Type: instance method of Player
Returns if the control bar is opened.
Type: instance method of Player
Returns: boolean
Toggles the subtitle menu options.
Type: instance method of Player
Change the URL of the content without changing the instance.
Type: instance method of Player
Moves along to the next element that can be focused. The possible elements to be focused are: 'nexplayer_play_pause', 'nexplayer_full_volume_div', 'nexplayer_language', 'nexplayer_full_screen', 'nexplayer_return_container'
Type: instance method of Player
Moves along to the previous element that can be focused. The possible elements to be focused are: 'nexplayer_play_pause', 'nexplayer_full_volume_div', 'nexplayer_language', 'nexplayer_full_screen', 'nexplayer_return_container'.
Type: instance method of Player
Click the current focused element.
Type: instance method of Player
Hides or shows the playback bar.
Type: instance method of Player
Informs if the video is full screen or not
Type: instance method of Player.Player
Returns: boolean - true if the video is fullscreen, otherwise it returns false.
Returns the parameters defined in the set up, for that video
Type: instance method of Player.Player
Returns the play back speed.
Type: instance method of Player
Returns: Number
Returns the type of video (DASH/ HLS/ mp4 ...)
Type: instance method of Player
Returns: String
Returns true if the video has ended.
Type: instance method of Player
Returns: boolean
Returns true while an ad is played back or content playback has been paused for ad playback, false otherwise.
Type: instance method of Player
Returns: boolean
Returns true if the video state is paused, otherwise false
Type: instance method of Player
Returns: boolean
Returns true if the video state is playing, otherwise false
Type: instance method of Player
Returns: boolean
Returns true if the player has finished initialization and is ready to use and to handle other API calls.
Type: instance method of Player
Returns: boolean
To enter picture in picture mode
Type: instance method of Player
To exit picture in picture mode
Type: instance method of Player
Returns true if the video is in picture in picture, otherwise false.
Type: instance method of Player
Returns: boolean
Return true if pictur in pictur mode is supported for the browser, otherwise false.
Type: instance method of Player
Returns: boolean
Returns the version of the SDK.
Type: instance method of Player
Returns: String
player.hiddenVolumeIcon()
Hides the volume icon.
Type: instance method of Player
Shows the volume icon.
Type: instance method of Player
Get the thumbnail at a specific video time.
Param | Type | Description |
---|---|---|
Time | number |
Get thumbnails at the given time. |
Type: instance method of Player
Returns: Promise <Frame, object> - Frame as resolve, and object which contains details as a reject.
Returns the AdManager instance in order to perform actions on ads through the IMA SDK.
Type: instance method of Player
Returns: AdManager object
Returns the IMA SDK manager object.
Type: instance method of Player
Returns: IMAs AdManager object
Returns the ID of the current ad.
Type: instance method of Player
Returns: String
Returns the title of the current ad.
Type: instance method of Player
Returns: String
Returns the description of the current ad.
Type: instance method of Player
Returns: String
Returns the video ad URL.
Type: instance method of Player
Returns: String
Returns the ad survey URL.
Type: instance method of Player
Returns: String
Returns the total duration of the current ad.
Type: instance method of Player
Returns: number
Returns how much time is left until the user can skip the ad (only if it is skippable).
Type: instance method of Player
Returns: number
Returns the current time position of the ad.
Type: instance method of Player
Returns: number
Returns the ad video type (e.g. "video/mp4").
Type: instance method of Player
Returns: String
Returns whether the ad is skippable or not.
Type: instance method of Player
Returns: boolean
Returns whether the ad is linear or not.
Type: instance method of Player
Returns: boolean
Returns whether the ad is in the VPAID format or not.
Type: instance method of Player
Returns: boolean
Pauses the ad.
Type: instance method of Player
Plays the ad when it is paused.
Type: instance method of Player
Skips the ad (if possible).
Type: instance method of Player
Closes the ad and starts the video.
Type: instance method of Player
Set the volume for the current ad.
Type: instance method of Player
Param | Type | Description |
---|---|---|
value | number |
The volume to set, from 0 (muted) to 1 (loudest). |
Removes ad assets loaded at runtime that need to be properly removed at the time of ad completion and stops the ad and all tracking.
Type: instance method of Player
If an ad break is currently playing, discard it and resume content. Otherwise, ignore the next scheduled ad break. For example, this can be called immediately after the ads manager loads to ignore a preroll without losing future midrolls or postrolls. This is a no-op unless the ad request returned a playlist or VMAP response.
Type: instance method of Player
Puts the focus on the skip button, if exists. Otherwise, the focus is put on interactive elements, including icons or interactive creatives.
Type: instance method of Player
Returns true if the current ad can be skipped.
Return: boolean
True if the current ad can be skipped, false otherwise.
Type: instance method of Player
Returns an array of offsets in seconds indicating when a scheduled ad break will play. A preroll is represented by 0, and a postroll is represented by -1. An empty array indicates the ad or ad pod has no schedule and can be played at any time.
Return non-null Array of number
List of time offsets in seconds.
Type: instance method of Player
Get the remaining time of the current ad that is playing. If the ad is not loaded yet or has finished playing, the API would return -1.
Return number
Returns the time remaining for current ad. If the remaining time is undefined for the current ad (for example custom ads), the value returns -1.
Type: instance method of Player
Get the volume for the current ad.
Return number
The volume of the current ad, from 0 (muted) to 1 (loudest).
Type: instance method of Player
Call init to initialize the ad experience on the ads manager.
Get the volume for the current ad.
Param | Type | Description |
---|---|---|
width | number |
The desired width of the ad. |
height | number |
The desired height of the ad. |
viewMode | viewMode |
The desired view mode. Value must not be null. |
videoElement | Optional |
HTMLVideoElement The video element for custom playback. This video element overrides the one provided in the AdDisplayContainer constructor. Only use this property if absolutely necessary - otherwise we recommend specifying this video element while creating the AdDisplayContainer. Value may be null. |
Type: instance method of Player
Returns true if a custom video element is being used to play the current ad.
Return boolean
Whether custom playback is used.
Type: instance method of Player
Resizes the current ad.
Param | Type | Description |
---|---|---|
width | number |
New ad slot width. |
height | number |
New ad slot height. |
viewMode | viewMode |
The new view mode. Value must not be null. |
Type: instance method of Player
The source ad server information included in the ad response.
Return: string
The source ad server of the ad, or the empty string if this information is unavailable.
Type: instance method of Player
The advertiser name as defined by the serving party.
Return: string
The advertiser name, or the empty string if this information is unavailable.
Type: instance method of Player
Identifies the API needed to execute the ad. This corresponds with the apiFramework specified in vast.
Return: nullable string
The API framework need to execute the ad, or null if this information is unavailable.
Type: instance method of Player
Returns the ISCI (Industry Standard Commercial Identifier) code for an ad, or empty string if the code is unavailable. This is the Ad-ID of the creative in the VAST response.
Return: string
Type: instance method of Player
Retrieves the ID of the selected creative for the ad.
Return: string
The ID of the selected creative for the ad, or the empty string if this information is unavailable.
Type: instance method of Player
Returns the first deal ID present in the wrapper chain for the current ad, starting from the top. Returns the empty string if unavailable.
Return: string
Type: instance method of Player
Returns the height of the selected non-linear creative.
Return: number
The height of the selected non-linear creative or 0 for a linear creative.
Type: instance method of Player
Returns the minimum suggested duration in seconds that the nonlinear creative should be displayed. Returns -2 if the minimum suggested duration is unknown. For linear creative it returns the entire duration of the ad.
Return: number
The minimum suggested duration in seconds that a creative should be displayed.
Type: instance method of Player
Gets custom parameters associated with the ad at the time of ad trafficking.
Return: non-null Object with string properties
A mapping of trafficking keys to their values, or the empty Object if this information is not available.
Type: instance method of Player
Gets custom parameters associated with the ad at the time of ad trafficking. Returns a raw string version of the parsed parameters from getTraffickingParameters.
Return: string
Trafficking parameters, or the empty string if this information is not available.
Type: instance method of Player
Returns the UI elements that are being displayed when this ad is played. Refer to UiElements for possible elements of the array returned.
Return: non-null Array of string
The UI elements being displayed.
Type: instance method of Player
The registry associated with cataloging the UniversalAdId of the selected creative for the ad.
Deprecated: Use ad.getUniversalAdIds() instead.
Return: string
Returns the registry value, or "unknown" if unavailable.
Type: instance method of Player
The list of UniversalAdIds of the selected creative for the ad.
Return: non-null Array of non-null UniversalAdIdInfo
Returns the list of universal ad ID information that applies for this ad.
Type: instance method of Player
The UniversalAdId of the selected creative for the ad.
Deprecated: Use ad.getUniversalAdIds() instead.
Return: string
Returns the id value or "unknown" if unavailable.
Type: instance method of Player
When both the creative and the media file have been selected by the SDK, this will return the bitrate for the media file as listed in the vast response.
Return: number
The bitrate for the selected media file or 0.
Type: instance method of Player
Returns the VAST media height of the selected creative.
Return: number
The VAST media height of the selected creative or 0 if none is selected.
Type: instance method of Player
Returns the VAST media width of the selected creative.
Return: number
The VAST media width of the selected creative or 0 if none is selected.
Type: instance method of Player
Returns the width of the selected creative.
Return: number
The width of the selected non-linear creative or 0 for a linear creative.
Type: instance method of Player
Ad IDs used for wrapper ads. The IDs returned starts at the inline ad (innermost) and traverses to the outermost wrapper ad. An empty array is returned if there are no wrapper ads.
Return: non-null Array of string
The IDs of the ads, starting at the inline ad, or an empty array if there are no wrapper ads.
Type: instance method of Player
Ad systems used for wrapper ads. The ad systems returned starts at the inline ad and traverses to the outermost wrapper ad. An empty array is returned if there are no wrapper ads.
Return: non-null Array of string
The ad systems of the ads, starting at the inline ad, or an empty array if there are no wrapper ads.
Type: instance method of Player
Selected creative IDs used for wrapper ads. The creative IDs returned starts at the inline ad and traverses to the outermost wrapper ad. An empty array is returned if there are no wrapper ads.
Return: non-null Array of string
The IDs of the ads' creatives, starting at the inline ad, or an empty array if there are no wrapper ads.
Type: instance method of Player
Indicates whether the ad’s current mode of operation is linear or non-linear. If the value is true, it indicates that the ad is in linear playback mode; if false, it indicates non-linear mode. The player checks the linear property and updates its state according to the details of the ad placement. While the ad is in linear mode, the player pauses the content video. If linear is true initially, and the ad is a pre-roll (defined externally), the player may choose to delay loading the content video until near the end of the ad playback.
Return: boolean
True if the ad is linear, false otherwise.
Type: instance method of Player
Sets a listener function called each time the user clicks on the ad.
Type: instance method of Player
Param | Type | Description |
---|---|---|
func | function |
the function called when the user clicks on the ad |
Sets a listener function called each time the user mutes the ad's volume.
Type: instance method of Player
Param | Type | Description |
---|---|---|
func | function |
the function called when the user mutes the ad |
Sets a listener function called each time the user changes the ad's volume.
Type: instance method of Player
Param | Type | Description |
---|---|---|
func | function |
the function called when the user changes the ad's volume |
Sets a listener function called each time the user skips the ad.
Type: instance method of Player
Param | Type | Description |
---|---|---|
func | function |
the function called when the user skips the ad |
Sets a listener function called each time the user pauses the ad.
Type: instance method of Player
Param | Type | Description |
---|---|---|
func | function |
the function called when the user pauses the ad |
Sets a listener function called each time the user resumes the ad.
Type: instance method of Player
Param | Type | Description |
---|---|---|
func | function |
the function called when the user resumes the ad |
Sets a listener function called when the ad starts.
Type: instance method of Player
Param | Type | Description |
---|---|---|
func | function |
the function called when the ad starts |
Sets a listener function called when the ad reaches the first quartile of the video duration.
Type: instance method of Player
Param | Type | Description |
---|---|---|
func | function |
the function called when the ad reaches the first quartile of the video duration |
Sets a listener function called when the ad reaches the middle of the video duration.
Type: instance method of Player
Param | Type | Description |
---|---|---|
func | function |
the function called when the ad reaches the middle of the video duration |
Sets a listener function called when the ad reaches the third quartile of the video duration.
Type: instance method of Player
Param | Type | Description |
---|---|---|
func | function |
the function called when the ad reaches the third quartile of the video duration |
Sets a listener function called when the ad finishes.
Type: instance method of Player
Param | Type | Description |
---|---|---|
func | function |
the function called when the ad finishes |
Sets a listener function called when the impression URL has been pinged.
Type: instance method of Player
Param | Type | Description |
---|---|---|
func | function |
the function called when the impression URL has been pinged |
Sets a listener function called when the ad fails during loading or playing.
Type: instance method of Player
Param | Type | Description |
---|---|---|
func | function |
the function called when the ad fails during loading or playing |
Sets a listener function called when the ad is blocked by an external app.
Type: instance method of Player
Param | Type | Description |
---|---|---|
func | function |
the function called when the ad is blocked by an external app |
Type: static enum of Player
Read only: true
Properties:
Name | Type | Default |
---|---|---|
HLS | number |
0 |
DASH | number |
1 |
PROGRESSIVE_DOWNLOAD | number |
2 |
UNKNOWN | number |
3 |
OTHER | number |
4 |
Type: static enum of Player
Read only: true
Properties:
Name | Type | Default |
---|---|---|
Track_Change | number |
0 |
Fragment_Loading_Completed | number |
1 |
Player_Destroyed | number |
2 |
Speed_Change | number |
3 |
Error | number |
4 |
Cue_Change | number |
5 |
Fragment_Buffered | number |
6 |
Playlist_Loading_Completed | number |
7 |
Fragment_Loading | number |
8 |
Invalid_License | number |
9 |
Frames_Drop_Capping | number |
10 |
Type: static enum of Player
Read only: true
Properties:
Name | Type | Default |
---|---|---|
STATIC_THUMBNAILS | number |
0 |
DYNAMIC_THUMBNAILS | number |
1 |
Called when a NexEvent happens.
Type: global typedef
Called when a FairPlay content needs to request the license.
Type: global typedef
Param | Description |
---|---|
event | when the webkitkeymessage event from FairPlay is called. |
Type: global typedef Properties:
Name | Type | Description |
---|---|---|
FieldName | string |
of the HTTPHeaders. |
FieldValue | string |
of the HTTPHeaders. |
Type: global typedef Properties:
Name | Type | Description |
---|---|---|
NexDRMType | string |
NexDRMType of the video. |
NexDRMKey | string |
NexDRMKey of the video. |
NexHeaders | Array.<NexHeaders> |
NexHeaders of the video. |
NexCallback | NexCallback |
NexCallback for FairPlay content. |
Type: global typedef Properties:
Name | Type | Description |
---|---|---|
width | number |
width of the video. |
height | number |
height of the video. |
bitrate | number |
bitrate of the video. |
id | number |
id of the video. |
- Bitrate property is not available on Safari iOS, Fairplay protected videos on Safari Mac OS or .mp4 videos.
Type: global typedef Properties:
Name | Type | Description |
---|---|---|
id | number |
id of the stream. |
language | number |
language of the stream. |
name | number |
name of the stream. |
Type: global typedef Properties:
Name | Type | Description |
---|---|---|
f | canvas |
Thumbnail canvas instance. |
w | number |
Width. |
h | number |
Height. |
st | number |
Thumbnail starting time. |
ft | number |
Thumbnail ending time. |
Set the field of view.
Type: instance method of Player
Param | Type | Description |
---|---|---|
fov | number | the fov value. |
get the field of view.
Type: instance method of Player
Returns: number
Creates and initializes the player.
Type: function of nexplayer
Param:
- configuration is an object which its properties values could be:
Mandatory Parameters:
Param | Type | Description |
---|---|---|
key | string |
NexPlayer key to validate the playback. |
div | HTMLDivElement |
Div container of the player. |
src | string |
Relevant src of the video to be played. |
Optional Parameters:
Param | Type | Description |
---|---|---|
allowScreenPlayPause | boolean |
Allows to play and pause the video clicking on it. |
autohide | boolean |
Sets if the UI must hide when the user does not interact with the video. True by default. |
autoplay | boolean |
Determines if the video must start playing or paused. True by default. |
blockZoom | boolean |
Determines if the zoom in 360 videos is available or not. |
callbackForLogger | Function |
Function to be called when the logger shows a message. |
callbackForReturn | Function |
Sets a callback checkSupportedConfigurations(URL, DRMType) to be executed when the corresponding button is clicked. |
callbacksForPlayer | Function |
Used for retrieving the nexplayer instance and video element. This is necessary for getting the instance and use the NexPlayer API. |
cast | boolean |
Determines if the cast will be enabled or not. |
chromecastEndImg | string |
URL of an image to be used as ending. |
chromecastLaunchImg | string |
URL of an image to be used at launch. |
debug | boolean |
Determines if log information is showed. By default is set to true. |
defaultQuality | number |
Sets the starting track through its id. By default is -1, this enables the ABR. |
disableFullscreen | boolean |
Determines if the full screen will be enabled. |
disableKeyEvents | boolean |
Determines if the keyboard keys can be used to control the video (play/pause, forward/backward and volume up/down). |
drm | Array<NexDRMInformation> |
Contains an array of DRM information. By default it's set to null. |
externSubtitles | Array |
Used to provide subtitle files as external subtitles. |
hideOptionsUi | Object |
Hides the setting that you choose from the UI. |
hideScreenPlay | boolean |
Hides the play button in the middle of the video, which appears when the video is paused. |
hideVolumeIcon | boolean |
Determines if the volume icon will be hidden for mobile devices. The volume is controlled by the device buttons. |
lowLatency | boolean |
Determines if the low latency will be enabled. |
liveSettings | Object |
Settings to control live playback. Requires low latency. |
logosrc | string |
Company URL logo. |
mutedAtStart | boolean |
Determines if the video will start playing muted or not. By default this value is set to false. |
pip | boolean |
Determines if picture-in-picture will be enabled. |
poster | string |
Video poster URL. |
seekUI | number |
Sets the number of seconds the UI buttons will seek forwards or backwards. Set to 10s by default. |
showingFullUI | boolean |
Determines if the UI is hidden or not. |
showUI360 | boolean |
Determines if the 360UI will be enabled. |
srcSets | Array |
Array of objects that contains a stream and an optional DRM. |
staticThumbnailsImage | string |
Image to extract thumbnails from. |
staticThumbnailsVTT | string |
Used to provide the player an external thumbnails VTT file. |
startingBufferLength | number |
Determines the buffer that the video should have before start. |
startFullscreen | boolean |
Determines if the video will start on full screen. |
subtitle | string |
Video subtitle name. |
timeUI | boolean |
Determines if the video time will be hidden on the UI. |
title | string |
Video name. |
type_360 | string |
Selects the 360 video format to play. Possible values are 'equirectangular', 'cubemap' and 'topdown'. |
useDynamicThumbnails | boolean |
Determines if dynamic thumbnails are used. By default this value is set to false. |
useiOSFullScreen | boolean |
Determines if the iOS native full screen will be used. |
vast | string |
Advertisement URL that is going to be played. VAST, VPAID and VMAP are supported. |
watermark | object |
Watermark image URL. |
withCredentials | boolean |
Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates. |
cmcd | Object |
Enables the Common Media Client Data. Only needs to create an empty object to enable it. |
licenseWithCredentials | boolean |
Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates with DRM. |
maxFrameDrop | number |
The value of this property should be within the range 0 - 1. A Frames_Drop_Capping event will be triggered whenever the percentage of frames dropped is higher than this threshold. |
xhrSetHeader | Array |
You can configure the headers that are necessary for the URL request. |
This method stores each new player which will allow the MultipleView instance to control all the videos.
Type: instance method of Player
This method only has to be called once in the index and starts all the videos sequentially. It must be called after all videos are set.
Type: instance method of Player
Enables toggle between play and pause.
Type: instance method of Player
Sets the currentTime property of the attached video element. (if isUTC is true, the seek value will be in a different format than the currentTime of the video element).
Type: instance method of Player
Param | Type | Description |
---|---|---|
event | Event | value in seconds that the player will seek to. |
Jump to the livestream current time from the current position (if isUTC is true, the seek value will be in a different format than the currentTime of the video element). only works in livestream.
Type: instance method of Player
Parse youtube url to extract the id of the video
Type: instance method of Player