Player

Kind: global class
Struct:
Export:

new Player()

Constructs a NexPlayer.

player.Init(key, div, videoElement, URL, nexDRMInformation, displayableinCanvas, protocolType, debugLog) ⇒ Promise

Initializes the player.

Kind: instance method of Player
Returns: Promise - that will be resolved when its successfully initializes.
Export:

Param Type Description
key string that validets the playback.
div HTMLDivElement
videoElement HTMLVideoElement that will output the video.
URL string of the video to be played.
nexDRMInformation Array.<NexDRMInformation> that contains an array of DRM information. By default it is null.
displayableinCanvas boolean that will inform if the videoElement will be used to generate external textures to be displayed in a canvas. By default it is false.
protocolType NexProtocol that will define the protocol type. By default it is UNKNOWN and it will be obtained from the URL.
debugLog boolean that will set the output of extra logs. By default it is false.

player.getTracks() ⇒ Array.<Track>

Get all the video tracks.

Kind: instance method of Player
Returns: Array.<Track> - all the tracks available.
Export:

player.getCurrentTrack() ⇒ Track

Get the current track information.

Kind: instance method of Player
Returns: Track - the current track.
Export:

player.setCurrentTrack(trackID)

Set the current tack.

Kind: instance method of Player
Export:

Param Type Description
trackID number ID of the track to be used.

player.enableABR()

Enable the ABR to change automatically between tracks.

Kind: instance method of Player
Export:

player.getAudioStreams() ⇒ Array.<AudioStream>

Get the available audio streams.

Kind: instance method of Player
Returns: Array.<AudioStream> - the list of the available audio streams.
Export:

player.getCurrentAudioStream() ⇒ AudioStream

Get the audio stream currently in use.

Kind: instance method of Player
Returns: AudioStream - the current audio track.
Export:

player.setAudioStream(streamID)

Set the current audio stream.

Kind: instance method of Player
Export:

Param Type Description
streamID number ID of the audio stream to be used.

player.isLive() ⇒ boolean

Informs if the video is live or on demand (VOD).

Kind: instance method of Player
Returns: boolean - true if the video is live, false otherwise.

player.on(callbackType, functionToBeCalled)

Adds a listener for an Event.

Kind: instance method of Player
Export:

Param Type Description
callbackType NexEvent Event to listen.
functionToBeCalled NexCallbackEvent Function called on each event.

player.attachSubtitleRendererDiv(subtitleRendererDiv)

Adds a DIV to render certain subtitles in a more exact way. This is optional and the native subtitles of the video element will be used if this is not set.

Kind: instance method of Player
Export:

Param Type Description
subtitleRendererDiv subtitleRendererDiv DIV to render some advance subtitles.

player.create360View()

Creates the 360 view.

Kind: instance method of Player
Export:

player.FairPlayNexLicenseRequestLoaded(event)

Called this when the FairPlay request is done

Kind: instance method of Player
Export:

Param Type
event Event

player.FairPlayNexLicenseRequestFailed(event)

Called this in case of a FairPlay request fail

Kind: instance method of Player
Export:

Param Type
event Event

player.setThumbnailResources(callback, vttURl, imageURL)

Set thumbnails resources. This method should be called before Init().

Kind: instance method of Player
Export:

Param Type Description
callback NexCallbackEvent functionToBeCalled Function when thumbnails are loaded.
vttURl String path to vtt thumbnails file.
imageURL String path to image thumbnails file.

player.isUTC() ⇒ boolean

Indicates if 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, seeking through the currentTime of the video element, will need to be done taking it into account. Some useful methods, like getCurrentTime, getDuration and seek, are available to reduce the complexity in these cases. Note that this property only applies for live streams.

Kind: instance method of Player
Returns: boolean - true if the video information is using UTC, false otherwise.

player.getCurrentTime() ⇒ number

Returns the currentTime taking into account isUTC (in these cases it will be different from the currentTime of the video element).

Kind: instance method of Player
Returns: number - the current time of the video.

player.getDuration() ⇒ number

Returns the duration taking into account isUTC (in those cases it will be different from the duration of the video element).

Kind: instance method of Player
Returns: number - the duration of the video.

player.seek(value)

Sets the position of the playback. (in those cases setting this will be different from the currentTime of the video element).

Kind: instance method of Player

Param Type Description
value number value that the player will seek to.

player.sendImpression()

Send the impression details to the server, only for internal management.

Kind: instance method of Player

player.getProtocol() ⇒ number

Returns the protocol type

Kind: instance method of Player
Returns: number - the duration of the video.

player.getThumbnailController() ⇒ ThumbController

Returns the preview thumbnail controller

Kind: instance method of Player
Returns: ThumbController - Thumbnail controller

player.setThumbnailStep(step)

Set step for dynamic thumbnails

Kind: instance method of Player

Param Type Description
step number the seconds between two different thumbnails

player.enablePreviewThumbnails(option)

Enable preview thumbnails. This method must be called before Init().

Kind: instance method of Player

Param Type Description
option boolean the value that enable or not the thumbnails

player.setSpeed(speed)

Set the video playback speed.

Kind: instance method of Player

Param Type Description
speed number the value of the speed

player.getQualityLevels() ⇒ array

Get the video quality levels array

Kind: instance method of Player
Returns: array - quality levels array info

player.setTrack(qualityLevel)

Set the video quality level

Kind: instance method of Player

Param Type Description
qualityLevel number index of the quality level

player.togglePlayPause()

Toggle between play and pause.

player.toggleFullScreen()

Toogle between full screen and not full screen

Kind: instance method of Player
Export:

player.adManager()

Returns the AdManager instance in order to perform actions on ads through the IMA SDK

Kind: instance method of Player
Returns: AdManager object

player.adManager().getAdObject()

Returns the IMA SDK manager object

Kind: instance method of Player
Returns: IMAs AdManager object

player.adManager().getId()

Returns the ID of the current ad

Kind: instance method of Player
Returns: String

player.adManager().getTitle()

Returns the title of the current ad

Kind: instance method of Player
Returns: String

player.adManager().getDescription()

Returns the description of the current ad

Kind: instance method of Player
Returns: String

player.adManager().getMediaURL()

Returns the video ad URL

Kind: instance method of Player
Returns: String

player.adManager().getSurveyURL()

Returns the ad survey URL

Kind: instance method of Player
Returns: String

player.adManager().getDuration()

Returns the total duration of the current ad

Kind: instance method of Player
Returns: number

player.adManager().getSkipTime()

Returns how much time is left until the user can skip the ad (only if it is skippable)

Kind: instance method of Player
Returns: number

player.adManager().getCurrentTime()

Returns the current time position of the ad

Kind: instance method of Player
Returns: number

player.adManager().getContentType()

Returns the ad video type (ex. "video/mp4")

Kind: instance method of Player
Returns: String

player.adManager().isSkippable()

Returns whether the ad is skippable or not

Kind: instance method of Player
Returns: boolean

player.adManager().isLinear()

Returns whether the ad is linear or not

Kind: instance method of Player
Returns: boolean

player.adManager().isVpaid()

Returns whether the ad is in the VPAID format or not

Kind: instance method of Player
Returns: boolean

player.adManager().pause()

Pauses the ad

Kind: instance method of Player

player.adManager().play()

Plays the ad when it is paused

Kind: instance method of Player

player.adManager().skip()

Skips the ad if possible

Kind: instance method of Player

player.adManager().abort()

Closes the ad and starts the video

Kind: instance method of Player

player.adManager().addClickListener(func)

Sets a listener function called each time the user clicks on the ad

Kind: instance method of Player

Param Type Description
func function the function called when the user clicks

player.adManager().addVolumeMutedListener(func)

Sets a listener function called each time the user mutes the ad's volume

Kind: instance method of Player

Param Type Description
func function the function called when the user mutes the ad

player.adManager().addVolumeChangedListener(func)

Sets a listener function called each time the user changes the ad volume

Kind: instance method of Player

Param Type Description
func function the function called when the user changes the ad volume

player.adManager().addSkippedListener(func)

Sets a listener function called each time the user skips the ad

Kind: instance method of Player

Param Type Description
func function the function called when the user skips the ad

player.adManager().addPausedListener(func)

Sets a listener function called each time the user pauses the ad

Kind: instance method of Player

Param Type Description
func function the function called when the user pauses the ad

player.adManager().addResumedListener(func)

Sets a listener function called each time the user resumes the ad

Kind: instance method of Player

Param Type Description
func function the function called when the user resumes the ad

player.adManager().addStartedListener(func)

Sets a listener function called when the ad starts

Kind: instance method of Player

Param Type Description
func function the function called when the ad starts

player.adManager().addFirstQuartileListener(func)

Sets a listener function called when the ad reaches the first quartile of the video duration

Kind: instance method of Player

Param Type Description
func function the function called when the ad reaches the first quartile of the video duration

player.adManager().addMidpointListener(func)

Sets a listener function called when the ad reaches the middle of the video duration

Kind: instance method of Player

Param Type Description
func function the function called when the ad reaches the middle of the video duration

player.adManager().addThirdQuartileListener(func)

Sets a listener function called when the ad reaches the third quartile of the video duration

Kind: instance method of Player

Param Type Description
func function the function called when the ad reaches the third quartile of the video duration

player.adManager().addCompleteListener(func)

Sets a listener function called when the ad finishes

Kind: instance method of Player

Param Type Description
func function the function called when the ad finishes

Player.NexProtocol : enum

Kind: static enum of Player
Read only: true
Properties

Name Type Default
HLS number 0
DASH number 1
PROGRESSIVE_DOWNLOAD number 2
UNKNOWN number 3
SHAKA number 4

Player.NexEvent : enum

Kind: static enum of Player
Read only: true
Properties

Name Type Default
Track_Change number 0
Fragment_Loading_Completed number 1

Player.THUMB_TYPE : enum

Kind: static enum of Player
Read only: true
Properties

Name Type Default
STATIC_THUMBNAILS number 0
DYNAMIC_THUMBNAILS number 1

NexCallbackEvent : function

Called when a NexEvent happens.

Kind: global typedef

NexCallback : function

Called when a FairPlay content needs to request the license.

Kind: global typedef

Param Description
event when the webkitkeymessage event from FairPlay is called.

NexHeaders : Object

Kind: global typedef
Properties

Name Type Description
FieldName string of the HTTPHeaders.
FiledValue string of the HTTPHeaders.

NexDRMInformation : Object

Kind: global typedef
Properties

Name Type Description
NexDRMType string NexDRMType of the video.
NexDRMKey string NexDRMKey of the video.
NexHeaders Array.<NexHeaders> NexHeaders the video.
NexCallback NexCallback NexCallback for FairPlay content.

Track : Object

Kind: global typedef
Properties

Name Type Description
width number width of the video.
height number height of the video.
bitrate number bitrate the video.
id number id the video.

AudioStream : Object

Kind: global typedef
Properties

Name Type Description
id number id of stream.
language number language of the stream.
name number name of the stream.

results matching ""

    No results matching ""