Video Advertising Suite

Docs

Classes

FacadeBase

Typedefs

MediaError : Object

https://developer.mozilla.org/en-US/docs/Web/API/MediaError

ElementSize : Object
EnvironmentVars : Object

Used for passing implementation-specific runtime variables.

FacadeBase

Kind: global class

new FacadeBase()

A player proxy class (last change 2023-02-21T15:11:26.888Z)

facadeBase.PLAYER_EVENT_MAP ⇒ Object

Map player specific events to the corresponding HTML5 MediaEvent

Kind: instance property of FacadeBase

facadeBase.handshakeVersion(apiFacadeVersion) ⇒ string

Requests the player facade version (API version) to ensure the particular versions of smartclientcore and player facade are supported.

Kind: instance method of FacadeBase
Returns: string - Supported API version

Param Type Description
apiFacadeVersion string Required API version

facadeBase.load(url, autoPlay, disableSeeking) ⇒ Promise

Requests the video player to load and play the specified media file.

Kind: instance method of FacadeBase
Returns: Promise - Resolves if the player accepted the media file request

Param Type Default Description
url string Media file URI
autoPlay Boolean true Whether the requested media file starts playback immediately.
disableSeeking Boolean false Whether the requested source can be seeked back and forth.

facadeBase.addEventListener(type, callback)

Sets up a function that will be called whenever the specified event is delivered to the video player.

Kind: instance method of FacadeBase

Param Type Description
type string A case-sensitive string representing the player event type to listen for.
callback function The function which receives a notification when an event of the specified type occurs.

facadeBase.removeEventListener(type, callback)

Removes an event listener from the video player that has been registered with addEventListener() Note: The event listener to be removed must match with the listener that has been added.

Kind: instance method of FacadeBase

Param Type Description
type string A case-sensitive string representing the player event type to listen for.
callback function The function which receives a notification when an event of the specified type occurs.

facadeBase.lockContent() ⇒ Promise

Should freeze the current playback state (for later use with releaseContent()) and respond to the AdSlotAPI once finished.

Kind: instance method of FacadeBase
Returns: Promise - Current content source and playhead progress for VAST tracking enrichment

facadeBase.releaseContent() ⇒ Promise

Should restore the last known playback state, resume playback and respond to the AdSlotAPI once finished.

Kind: instance method of FacadeBase
Returns: Promise - Either resolves if the player accepted the play request or not

facadeBase.getCurrentContentSource() ⇒ SourceObject

Kind: instance method of FacadeBase
Returns: SourceObject - Current content source and playhead progress

facadeBase.getCurrentTime() ⇒ Number

Requests the current playhead position from the video player.

Kind: instance method of FacadeBase
Returns: Number - Current time in seconds.

facadeBase.getDuration() ⇒ Number

Requests the content-duration from the video player.

Kind: instance method of FacadeBase
Returns: Number - Total time in seconds.

facadeBase.getEnvironmentVars(adBreakType) ⇒ EnvironmentVars

Requests the latest status of the video player, site, and other external factors.

Kind: instance method of FacadeBase
Returns: EnvironmentVars - Description object of the most recent error or null.

Param Type Description
adBreakType string Linearity of the upcoming ad slot. See AdBreak.type

facadeBase.getError() ⇒ MediaError

Requests details about the most recent error that has occurred on the video player.

Kind: instance method of FacadeBase
Returns: MediaError - Description object of the most recent error or null.

facadeBase.getPlayerSize() ⇒ ElementSize

Requests the current size and viewMode from the video player.

Kind: instance method of FacadeBase
Returns: ElementSize - Current player dimension specs

facadeBase.getViewportSize() ⇒ ElementSize

Requests the current size and viewMode from the viewport that surrounds the video player.

Kind: instance method of FacadeBase
Returns: ElementSize - The dimension specs of the element

facadeBase.getVideoElement() ⇒ Element

Deprecated

Requests the video player element

Kind: instance method of FacadeBase
Returns: Element - The video element

facadeBase.getPlayerElement() ⇒ Element

Requests the player element

Kind: instance method of FacadeBase
Returns: Element - The video or audio element

facadeBase.setVolume(volume) ⇒ Promise

Requests the video player to change the volume.

Kind: instance method of FacadeBase
Returns: Promise - Resolves if the video player accepted the volume change request

Param Type Description
volume Number Requested volume level between 0-1

facadeBase.getVolume() ⇒ Number

Requests the current volume level from the video player.

Kind: instance method of FacadeBase
Returns: Number - The current volume level between 0-1

facadeBase.isMuted() ⇒ Boolean

Requests the current muted state from the video player.

Kind: instance method of FacadeBase
Returns: Boolean - Muted state

facadeBase.mute() ⇒ Promise

Requests the video player to mute playback.

Kind: instance method of FacadeBase
Returns: Promise - Resolves if the video player has been muted

facadeBase.unmute() ⇒ Promise

Requests the video player to unmute playback.

Kind: instance method of FacadeBase
Returns: Promise - Resolves if the video player has been unmuted

facadeBase.isPaused() ⇒ Boolean

Requests the current play state from the video player.

Kind: instance method of FacadeBase
Returns: Boolean - Playback state

facadeBase.pause() ⇒ Promise

Requests the video player to pause playback.

Kind: instance method of FacadeBase
Returns: Promise - Resolves if the video player has been paused

facadeBase.play() ⇒ Promise

Requests the video player to start (resume) playback.

Kind: instance method of FacadeBase
Returns: Promise - Resolves if the video player has been resumed

facadeBase.seek(offset) ⇒ Promise

Requests the video player to change the playhead position to the specified time.

Kind: instance method of FacadeBase
Returns: Promise - Resolves if the video player has finished seeking to the specified position

Param Type Description
offset Number Requested playhead position

MediaError : Object

https://developer.mozilla.org/en-US/docs/Web/API/MediaError

Kind: global typedef
Properties

Name Type Description
code number A number which represents the general type of error that occurred.
message string A human-readable string which provides specific diagnostic information to help the reader understand the error condition which occurred.

ElementSize : Object

Kind: global typedef
Properties

Name Type Description
boundingRect Object A rectangle that describes the size and position of the element (see HTML getBoundingClientRect)
viewMode string Either normal or fullscreen

EnvironmentVars : Object

Used for passing implementation-specific runtime variables.

Kind: global typedef
Properties

Name Type Description
desiredBitrate number Indicates the desired bitrate in kilobits per second (kbps). The player uses this information to select Mediafiles with an appropriate bitrate. Defaulting to null.
desiredMimeTypes [ 'Array' ].<string> Declaration of accepted media types. Defaulting to types that the browser eventually is able to play. Types must be compliant with the IANA Media Type standard
desiredVPAIDVendors [ 'Array' ].<string> Declaration of accepted VPAID vendors (whitelist). Each specified String has to represent an unique identifier that can be found within the creative media file URL, most likely the domain name. If omitted, the plugin tries to deliver VPAID creatives from each vendor.
deviceType string Can be either mobile, tablet, desktop or tv. Defaulting to null.
deviceScreenSize Dimension Maximum size we can achieve when entering fullscreen.
networkReachability string Can be either wan, wifi or unreachable. Defaulting to null.
vastMacros Object VAST macros and their values as defined in https://interactiveadvertisingbureau.github.io/vast/vast4macros/vast4-macros-latest.html
prefetchBuffetAds boolean In order to replace invalid ads in a pod instantly at runtime, buffet ads from wrapper responses must be loaded up-front. prefetchBuffetAds determines whether stand-alone ads (buffet) will be loaded together with the pod of ads or not. Defaulting to false if omitted.
adContainer HTMLElement The element that should be used to deliver non-video creative files. Defaulting to null if omitted.