Player Class

This is for Player operations. It depends to Device. Some methods are abstracted by Devices

Constructor

Player
(
  • currentDevice
  • events
  • config
)

Parameters:

  • currentDevice Object
    • Current device object
  • events Object
    • Events class inheritance
  • config Object
    • Config object

Methods

addAdsCaption () Boolean

Adds ads caption to video player to end user notified about Ads This text can be edited via config

Returns:

Boolean:

addVideoSource
(
  • src
  • customData
)

Adds video source to element. If trying to play DRM video you have to send customData with video source It sets this customData to player info so it can be accessible. Checks content address if it includes manifest regex it will start DRM functions automatically It catches DRM providers with currentDevice You can send HLS, Live HLS and Microsoft SS (PlayReady) content TODO DRM providers can be included in another function

Parameters:

  • src String
    • Source url for video content
  • customData String
    • Custom Data

checkAdsStatus ()

This function is triggered with timeUpdate event of video player. It compares with Vast time with current time

createOIPFDrmAgent ()

Drm initiator for OIPF Devices such as Vestel and Arcelik

createVideoElement ()

Creates Video element. It creates a HTML5 video element with config videoPlayerId Then you can reach this video element with this.videoElement It appends this video element to body. You have to set it to a fixed position with css. Most of Tv manufacturers runs its own video player and its position fixed to (0,0) cooridnates Its important to consider your design

Returns:

null

deleteVideoElement () Boolean

Removes videoElement from DOM. Its recommended to call this function if you are consider to close video TODO We have to check DRM inited if yes we have to detach DRM before removing

Returns:

Boolean:

initAds
(
  • type
  • url
)

Initialize ads with given source and type. So type is mandatory field to operate

Parameters:

  • type String
    • Type of ads source 'VMAP' or just 'VAST'
  • url Object
    • Url of ads source VMAP or VAST Url

Returns:

:

initAudioClass ()

Constructor for Audio class

initAudioClass ()

Add Subtitle Method

initVastAd
(
  • time
)

It starts ads in videoPlayer. Pauses current video then starting ads After completing ads it starts old src url with initial seeking with time

Parameters:

  • time Object
    • current time of video player

pause ()

Pause trigger for videoElement

play ()

Play trigger for videoElement

playWithLoop ()

Play trigger for a video element with endless autoloop you can use this feature to enable silent background videos

prepareVastFromVmap
(
  • vmapObject
)

If ads type is VMAP and detected in initAds method it will call automatically this function

Parameters:

  • vmapObject Object
    • Vmap object its response of VMAP XML

readVastFile
(
  • vastUrl
  • options
)

Reads Vast file and seperates its source and options (extensions, type etc)

Parameters:

  • vastUrl String
    • URL address for Vast
  • options Object
    • It stands for this.config.vastOptions

Returns:

}

registerVideoEvents ()

Trigger specific events for all videoElement trigger

restart ()

Sets currentTime to 0 and plays automatically

seekToTime
(
  • value
)

Seek to given time TODO Check device performances if needed use pause method first

Parameters:

  • value Object

seekWithTimeAdd
(
  • value
)

Seek with given value adding

Parameters:

  • value Number

sendWebOSDrm ()

WebOs Drm trigger

setPlayerInfo () Object

Sets this.playerInfo with initial values. This values usefull for later usages For example Vast, device specific, DRM Type etc we are using this object

Returns:

Object:

this.playerInfo

setupWebOSDrm ()

Initialize WebOs DRM TODO This can be move to webos device with abstract

stop ()

Stop trigger for videoElement it removes video element from dom

togglePlay ()

Play/Pause toggle trigger for videoElement

unloadDrmClient ()

Unloads DRM client. !IMPORTANT! Some devices may be crash if you are not unloaded drm client

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index