Type: global class
- Player
- instance
- .Setup(info)
- .getTracks() ⇒ Array.< Track >
- .getCurrentTrack() ⇒ Track
- .setCurrentTrack(trackID)
- .enableABR()
- .getAudioStreams() ⇒ Array.< AudioStream >
- .getCurrentAudioStream() ⇒ AudioStream
- .setAudioStream(streamID)
- .getCurrentSubtitle()
- .getSubtitles()
- .setSubtitle(subID)
- .isLive() ⇒ boolean
- .on(callbackType, functionToBeCalled)
- .attachSubtitleRendererDiv(subtitleRendererDiv)
- .create360View()
- .FairPlayNexLicenseRequestLoaded(event)
- .FairPlayNexLicenseRequestFailed(event)
- .setThumbnailResources(callback, vttURl, imageURL)
- .isUTC() ⇒ boolean
- .getCurrentTime() ⇒ number
- .getDuration() ⇒ number
- .getDVRWindowSize() ⇒ number
- .getURL()
- .checkFrameDrop() ⇒ number
- .seek(value)
- .seekLive()
- .getCurrentLiveTime() ⇒ number
- .getTimeUntilLive() ⇒ number
- .getManifestInfo()
- .getTimeShiftBufferDepth() ⇒ number
- .sendImpression()
- .getProtocol() ⇒ number
- .getThumbnailController() ⇒ ThumbController
- .setThumbnailStep(step)
- .enablePreviewThumbnails(option)
- .setSpeed(speed)
- .getQualityLevels() ⇒ array
- .setTrack(qualityLevel)
- .togglePlayPause()
- .toggleFullScreen()
- .showStats()
- .jumpForward(value)
- .jumpBackward(value)
- .setThumbnailStep(step)
- .getCurrentLiveLatency()
- .getCurrentBuffer()
- .toggleControlBar()
- .isControlBarOpen()
- .toggleLanguagesMenu()
- .nextFocus()
- .previousFocus()
- .clickFocus()
- .adManager()
- .getAdObject()
- .getId()
- .getTitle()
- .getDescription()
- .getMediaURL()
- .getSurveyURL()
- .getDuration()
- .getSkipTime()
- .getCurrentTime()
- .getContentType()
- .isSkippable()
- .isLinear()
- .isVpaid()
- .pause()
- .play()
- .skip()
- .abort()
- .addClickListener(func)
- .addVolumeMutedListener(func)
- .addVolumeChangedListener(func)
- .addSkippedListener(func)
- .addPausedListener(func)
- .addResumedListener(func)
- .addStartedListener(func)
- .addFirstQuartileListener(func)
- .addMidpointListener(func)
- .addThirdQuartileListener(func)
- .addCompleteListener(func)
- .addImpressionListener(func)
- .addErrorListener(func)
- .addBlockedListener(func)
- static
- .NexProtocol: enum
- .NexEvent: enum
- .THUMB_TYPE: enum
Creates and initializes the player.
Type: instance method of Player
Param: info is and object which its values could be:
| Param | Type | Description |
|---|---|---|
| key | string |
that validates the playback. |
| div | HTMLDivElement |
the div container of the player. |
| src | string |
of the video to be played. |
| autoplay | boolean |
determine if the video must start playing or paused. By default it's set to true. |
| drm | Array. |
contains an array of DRM information. By default it's set to null. |
| seekUI | number |
establish the number of seconds the UI buttons will seek forwards or backwards. By default is set to 10s. |
| mutedAtStart | boolean |
determine if the video will start playing muted or not. By default this value is set to false. |
| debug | boolean |
determine if log information is showed. By default is set to true. |
| type_360 | string |
select the 360 video format to play. Possible values are 'equirectangular', 'cubemap' and 'topdown'. |
| autohide | boolean |
establish if the UI must hide when the user does not interact with the video. By default is set to true.. |
| callbacksForPlayer | function |
used for retrieving the nexplayer instance and video element. This is necessary for getting the instance and use the NexPlayer API. |
| callbackForReturn | function |
establish a callback to be executed when the corresponding button is clicked. |
| callbackForLogger | function |
function to be called when the logger show a message. |
| vast | string |
advertisement url that is going to be played. VAST, VPAID, VMAP are supported. |
| useDynamicThumbnails | boolean |
determine if dynamic thumbnails are used. By default this values is set to false. |
| showingFullUI | boolean |
determine if the UI is hidden or not. |
| disableKeyEvents | boolean |
determine if the keyboard keys can be used to control the video (play/pause, forward/backward and volume up/down). |
Get all the video 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.
Set the current track.
Type: instance method of Player
Export:
| Param | Type | Description |
|---|---|---|
| trackID | number |
ID of the track to be used. |
Enable the ABR to change automatically between tracks.
Type: instance method of Player
Get the available audio streams.
Type: instance method of Player
Returns: Array. - the list of the available audio streams.
Get the audio stream currently in use.
Type: instance method of Player
Returns: AudioStream - the current audio track.
Set the current audio stream.
Type: instance method of Player
Export:
| Param | Type | Description |
|---|---|---|
| streamID | number |
ID of the audio stream to be used. |
Get the current subtitle info.
Type: instance method of Player
Returns: Current Subtitle - the current subtitle track (undefined if no subs are activated).
Get all the avaliable subtitle tracks info.
Type: instance method of Player
Returns: Array of subtitles - the subtitle tracks of the video.
Set 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). 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, false otherwise.
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.
Set 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) // It seeks into minute 2:00 in the video (120 secs), 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 2 minutes (120 secs) from the current live time, must be a negative number ranging from minus {the DVR window size} to 0Jump 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
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 time it's currently found in and the time the livestream is at.
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 livestream.
Type: instance method of Player
Returns: number - time shift buffer depth
#### player.sendImpression()
Send the impression details to the server (only for internal management).
Type: instance method of Player
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
Set 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
Set the video quality level.
Type: instance method of Player
Toggle between play and pause.
Type: instance method of Player
Toggle between full screen and windowed.
Type: instance method of Player
Display 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
Set 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
Toogle the subtitles menu options.
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
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
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 |
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. |
| FiledValue | 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. |
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. |