Options
All
  • Public
  • Public/Protected
  • All
Menu

API of oneplayerui.js

Hierarchy

  • IOnePlayerUi

Index

Audio Or Subtitles Tracks Methods

Audio3D Methods

BitrateLevel Methods

CSA Panel Methods

Cast Methods

Content Methods

Control Bar Action Methods

Fullscreen Methods

Header Action Methods

Message Box Methods

Next Chapter Methods

Other Methods

Pip Methods

Playback Control Methods

Player Debug Methods

Record Methods

Setup Methods

Subtitles Styles Methods

Volume Methods

Audio Or Subtitles Tracks Methods

enableText

  • enableText(enable: boolean): any
  • Enable text

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    • enable: boolean

    Returns any

getSelectedTrackForType

  • Returns the selected track for a given media type

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    Returns TrackInfo | null

    the selected track for the given media type

getTracksForType

  • Returns the list of tracks for a given media type

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    Returns TrackInfo[]

    The tracks for the given media type

isTextEnabled

  • isTextEnabled(): boolean
  • Returns true if text tracks are enabled, false otherwise.

    throw

    NOT_INITIALIZED error if not initialized

    Returns boolean

    true if text tracks are enabled, false otherwise

selectTrack

  • Select track

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    Returns any

setDefaultAudioLanguage

  • setDefaultAudioLanguage(lang: string, kind?: AudioKind): any
  • Sets the default audio language when loading a stream

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    • lang: string

      the default audio language code based on ISO 639-2

    • Optional kind: AudioKind

      the default audio track kind

    Returns any

setDefaultTextEnabled

  • setDefaultTextEnabled(enable: boolean): any
  • Sets the default text tracks enable state when loading a stream

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    • enable: boolean

      true if text tracks are enabled by default

    Returns any

setDefaultTextLanguage

  • setDefaultTextLanguage(lang: string, kind?: TextKind): any
  • Sets the default text language when loading a stream

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    • lang: string

      the default text language code based on ISO 639-2

    • Optional kind: TextKind

      the default text track kind

    Returns any

Audio3D Methods

enable3DAudio

  • enable3DAudio(enable: boolean): any
  • Enable/disable 3D audio

    Parameters

    • enable: boolean

      true to enable 3D audio, false otherwise

    Returns any

BitrateLevel Methods

enableBitrateLevel

  • enableBitrateLevel(enable: boolean): any
  • Enable/disable bitrate level

    Parameters

    • enable: boolean

      true to display bitrate menu list

    Returns any

getBitrateLevelList

  • Get current bitrate level list

    Returns BitrateLevelList

    bitrate list

getCurrentBitrateLevelId

  • getCurrentBitrateLevelId(): any
  • Get current bitrate identifier

    Returns any

    the identifier of current bitrate set. If empty, no bitrate level is configured

isBitrateLevelEnabled

  • isBitrateLevelEnabled(): boolean
  • Is bitrate level enabled

    Returns boolean

    true if bitrate level is enabled false otherwise

resetBitrateLevelConfig

  • resetBitrateLevelConfig(): any
  • Reset bitrate level configuration. The bitrate list will be cleaned

    Returns any

setBitrateLevelConfig

  • setBitrateLevelConfig(list: BitrateLevelList, defaultBitrateLevelId: string, minBitrateLevelId: string): any
  • Set bitrate level list

    Parameters

    • list: BitrateLevelList

      : the list of bitrate level

    • defaultBitrateLevelId: string

      : the default bitrate item identifier

    • minBitrateLevelId: string

      : the minimum bitrate item identifier

    Returns any

CSA Panel Methods

enableCsaPanel

  • enableCsaPanel(enabled: any): void
  • Enable display of csa panel on stream load. Default is false

    Parameters

    • enabled: any

      true to enable csa display on load, false otherwise

    Returns void

Cast Methods

cast

  • Cast an orange media file This can be done only if cast is enbaled and is CONNECTED state

    Parameters

    Returns any

enableCast

  • enableCast(appId: any): any
  • Only on Chrome Browser Enable cast function. By default, cast function is not enabled. Be careful, once enabled, you cannot disable it (restriction due to the way cast context is created, by Google)

    Parameters

    • appId: any

      : application id to start

    Returns any

getCastState

  • Get cast state

    Returns CastState

    cast state

Content Methods

displayInfoBanner

  • displayInfoBanner(): void
  • Display info banner

    Returns void

getChannelsData

  • Get channels data This is used for live

    Returns ChannelList

    information about current channel

getClockOffset

  • getClockOffset(): number
  • Get the current clock offset between server backend and local time of the user device

    Returns number

    offset time offset in seconds

getContentData

  • Get current content meta data This can be used for both ondemand and live

    Returns Content | null

    information about current content (can be null)

getCurrentChannelData

  • getCurrentChannelData(): Channel | null
  • Get current channel information This is used for live

    Returns Channel | null

    information about current channel

setChannelsData

  • Set channels informations, to display a VZL for instance This is used for live

    Parameters

    Returns void

setClockOffset

  • setClockOffset(offset: number): void
  • Set the clock offset between server time and the local time of the user device

    Parameters

    • offset: number

      : offset in seconds

    Returns void

setContentData

  • setContentData(content: Content | null): void
  • Set current content meta data, to display informations about video. This can be used for both ondemand and live

    Parameters

    • content: Content | null

      : information about current content

    Returns void

setCurrentChannelData

  • setCurrentChannelData(channel: Channel | null): void
  • Set current channel information, to display informations about current channel (logo, name ...) This is used for live

    Parameters

    • channel: Channel | null

      : information about current channel

    Returns void

setInfoDisplayConfiguration

  • Set configuration of info display panel

    Parameters

    Returns void

setPlaylist

  • setPlaylist(playlist: Playlist | null): void
  • Give a playlist of video content This is used for ondemand

    Parameters

    • playlist: Playlist | null

      : the playlist

    Returns void

Control Bar Action Methods

addControlBarAction

  • addControlBarAction(action: AppAction): void
  • Add a custom action button to toolbar

    Parameters

    Returns void

removeControlBarAction

  • removeControlBarAction(id: string): void
  • Remove a custom action button from toolbar

    Parameters

    • id: string

      : the action id to be removed

    Returns void

resetControlBarAction

  • resetControlBarAction(): void
  • Remove all custom action buttons from toolbar

    Returns void

showInfoPanelButton

  • showInfoPanelButton(show: boolean): void
  • Show/hide info panel button from control bar

    Parameters

    • show: boolean

      : true to show the button, false otherwise

    Returns void

Fullscreen Methods

enableFullscreenByApplication

  • enableFullscreenByApplication(enabled: any): any
  • Enable/disable fullscreen application handling (in electron for example ) If true, fulscreen will have to be managed by application

    Parameters

    • enabled: any

      true to enable fullscreen application mode

    Returns any

enableFullscreenMode

  • enableFullscreenMode(enabled: any): any
  • Enable/disable fullscreen mode

    Parameters

    • enabled: any

      true to enable fullscreen mode, false otherwise

    Returns any

isFullscreenMode

  • isFullscreenMode(): boolean
  • Check if one player ui is in fullscreen mode

    Returns boolean

    true if fullscreen mode is activated

setApplicationFullscreen

  • setApplicationFullscreen(fullscreen: any): any
  • Inform oneplayerui that application is fullscreen

    Parameters

    • fullscreen: any

    Returns any

    promise

setFullscreenMode

  • setFullscreenMode(fullscreen: any): any
  • Set one player ui in fullscreen mode

    Parameters

    • fullscreen: any

    Returns any

    promise

Header Action Methods

addHeaderAction

  • Add a custom action button to header

    Parameters

    Returns void

removeHeaderAction

  • removeHeaderAction(id: string): void
  • Remove a custom action button from header

    Parameters

    • id: string

      : the action id to be removed

    Returns void

resetHeaderAction

  • resetHeaderAction(): void
  • Remove all custom action buttons from header

    Returns void

Message Box Methods

dismissMessageBox

  • dismissMessageBox(): void
  • Delete current message box

    Returns void

error

  • Display an error message If another message box is displayed, the previous one is dismissed

    params

    {MessageBoxOptions} options : options to be used with message box

    Parameters

    Returns void

info

  • Display a warning message If another message box is displayed, the previous one is dismissed

    params

    {MessageBoxOptions} options : options to be used with message box

    Parameters

    Returns void

popin

  • Open and display a message box If another message box is displayed, the previous one is dismissed

    params

    {MessageBoxOptions} options : options to be used with message box

    Parameters

    Returns void

warn

  • Display a warning message If another message box is displayed, the previous one is dismissed

    params

    {MessageBoxOptions} options : options to be used with message box

    Parameters

    Returns void

Next Chapter Methods

showNextButton

  • showNextButton(show: boolean, text?: undefined | string): void
  • Show/hide next content (chapter, episode...) button in header control bar When loading a new stream, the button is reinitialized and hidden

    Parameters

    • show: boolean

      : true to show the button, false otherwise

    • Optional text: undefined | string

      : the button text to display ("Episode suivant" by default)

    Returns void

Other Methods

enableLastMediaSettingsCaching

  • enableLastMediaSettingsCaching(enable: boolean, key?: undefined | string): any
  • Enable/disable caching last media settings such as last audio and text selected language and text tracks state. When enabling caching, the settings are stored in local storage (if enabled) When disable caching, all stored settings are removed from local storage

    Parameters

    • enable: boolean

      true to enable, false to disable.

    • Optional key: undefined | string

      the local storage key for storing media settings (if enabled). Default value is 'oneplayer-media-settings'

    Returns any

focusPlayer

  • focusPlayer(noUI?: undefined | false | true): void
  • Give focus to player

    Parameters

    • Optional noUI: undefined | false | true

    Returns void

setPlayerLicense

  • setPlayerLicense(license: string): any
  • Set VOPlayer license. This is mandatory to use oneplayerui. You must ask for a licence

    Parameters

    • license: string

    Returns any

Pip Methods

enablePipMode

  • enablePipMode(enabled: boolean): any
  • Enable/disable pip mode

    Parameters

    • enabled: boolean

      true to enable pip mode, false otherwise

    Returns any

isPipMode

  • isPipMode(): boolean
  • Check if one player ui is in pip mode

    Returns boolean

    true if pip mode is activated

setPipMode

  • setPipMode(pip: boolean): any
  • Set one player ui in pip mode

    Parameters

    • pip: boolean

    Returns any

    promise

Playback Control Methods

enablePauseOnDragging

  • enablePauseOnDragging(value: any): any
  • Enable pause of video when timeline is being dragged (true by default) If true, this has effect only if stream has thumbnails. This parameter has priority over seekPreview parameter.

    Parameters

    • value: any

    Returns any

enableSeek

  • enableSeek(enable: boolean): any
  • Enable seek

    Parameters

    • enable: boolean

    Returns any

enableSeekPreview

  • enableSeekPreview(enable: boolean): any
  • Enable preview video when seeking (false by default)

    Parameters

    • enable: boolean

    Returns any

getCurrentTime

  • getCurrentTime(): number
  • Get player current time

    Returns number

getDisabledSeekTooltip

  • getDisabledSeekTooltip(): string | undefined
  • Get tooltip when seek is disabled

    Returns string | undefined

getDuration

  • getDuration(): number
  • Get player duration

    Returns number

getPlayerState

  • Get player state

    Returns PlayerState

    Current Player State

getVideoElement

  • getVideoElement(): HTMLMediaElement
  • Get video element

    Returns HTMLMediaElement

isPauseOnFraggingEnabled

  • isPauseOnFraggingEnabled(): any
  • Is pause of video enabled when timeline is being dragged (true by default)

    Returns any

isSeekEnabled

  • isSeekEnabled(): boolean
  • Get enabled seek flag

    Returns boolean

    true if seek is enabled , false otherwise

isSeekPreviewEnabled

  • isSeekPreviewEnabled(): any
  • Is preview video enabled when seeking

    Returns any

    true show preview video while dragging the progress bar thumb , false otherwise

load

  • Load/open a video stream and start playback.

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    Returns void

loadPlaylist

  • loadPlaylist(startÌndex?: undefined | number): void
  • Load current playlist.

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    • Optional startÌndex: undefined | number

      index of item to start

    Returns void

pause

  • pause(): void
  • Pause playback of the media.

    throw

    NOT_INITIALIZED error if not initialized

    Returns void

play

  • play(): void
  • Play/resume playback of the media.

    throw

    NOT_INITIALIZED error if not initialized

    Returns void

reload

  • Reload stream (this will reload the stream without displaying launching img...). It can be used to restart a stream after an error for example

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    Returns void

seek

  • seek(time: number): void
  • Seek the media to the new time. For LIVE streams, this function can be used to perform seeks within the DVR window if available.

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    • time: number

      the new time value in seconds

    Returns void

setDisabledSeekTooltip

  • setDisabledSeekTooltip(tooltip?: undefined | string): any
  • When seek is disabled, a tooltip can be dispalyed to explain why

    Parameters

    • Optional tooltip: undefined | string

      an optional string message to be displayed in progress bar tooltip, to explain why seek is disabled

    Returns any

stop

  • stop(): void
  • Stops/reset the playback of the video stream.

    throw

    NOT_INITIALIZED error if not initialized

    Returns void

updateManifestUrl

  • updateManifestUrl(url: string): void

Player Debug Methods

setPlayerLogLevel

  • setPlayerLogLevel(level: LogLevel): void
  • Set level for filtering internal player log messages.

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    Returns void

showPlayerDebug

  • showPlayerDebug(value: boolean): void
  • Show/Hide player debug window. By default, debug window is disabled

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    • value: boolean

    Returns void

Record Methods

enableRecord

  • enableRecord(enable: boolean): any
  • Enable/disable record button

    Parameters

    • enable: boolean

      true to display record button, false otherwise

    Returns any

getIsRecording

  • getIsRecording(): boolean
  • Get record button state

    Returns boolean

    true if is recording, false otherwise

isRecordEnabled

  • isRecordEnabled(): boolean
  • Is Record button enabled

    Returns boolean

    true if record button is enabled false otherwise

setIsRecording

  • setIsRecording(isRecording: boolean): any
  • Update record button state

    Parameters

    • isRecording: boolean

    Returns any

Setup Methods

getServiceType

  • get current service type for component. This will change control bar and some other UI components aspect

    Returns ServiceType

    type : the current service type

init

  • Initialize the component

    params

    options : initialization option

    Parameters

    Returns Promise<void>

    a promise which is resolved if player creation is successfull In case of failure, the promise is rejected with :

    • ALREADY_INITIALIZED if already initialized
    • if player creation falied, the error

isInitialized

  • isInitialized(): boolean
  • Gets initialisation state

    Returns boolean

    true if component is initialised, false otherwise

reset

  • reset(): void
  • Reset the component NB : You must recall init method if you want to reuse the component

    throw

    NOT_INITIALIZED error if not initialized

    Returns void

setLogLevel

  • Set level for filtering log messages.

    Parameters

    Returns any

setPlayerConfig

  • setPlayerConfig(params: PlayerConfiguration): any
  • Set configuration parameters that are specific to VOPlayer. Use this method if you want to override some default parameter value(s).

    Parameters

    • params: PlayerConfiguration

    Returns any

setServiceType

  • Set current service type for component. This will change control bar and some other UI components aspect

    Parameters

    Returns void

Subtitles Styles Methods

getSubtitleStyle

  • Returns current style

    Returns SubtitleStyle

    current style

setSubtitleStyle

  • Set current style

    throw

    NOT_ALLOWED_STYLE_COLOR_COUPLE error if subtitle font colors couple are not allowed

    Parameters

    Returns any

Volume Methods

decreaseVolume

  • decreaseVolume(): any
  • Deacrease volume with 0.1 step (do the same as Down arrow)

    throw

    NOT_INITIALIZED error if not initialized

    Returns any

getMute

  • getMute(): boolean
  • Returns state of mute

    throw

    NOT_INITIALIZED error if not initialized

    Returns boolean

    true if mute is active, false otherwise

getVolume

  • getVolume(): number
  • Returns current volume level (between 0 and 1)

    throw

    NOT_INITIALIZED error if not initialized

    Returns number

    current volume

increaseVolume

  • increaseVolume(): any
  • Increase volume with 0.1 step (do the same as Up arrow)

    throw

    NOT_INITIALIZED error if not initialized

    Returns any

setMute

  • setMute(mute: boolean): any
  • Set mute for the player

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    • mute: boolean

      true to mute the player, false otherwose

    Returns any

setVolume

  • setVolume(volume: number): any
  • Sets current volume (between 0 and 1)

    throw

    NOT_INITIALIZED error if not initialized

    Parameters

    • volume: number

      the new volume

    Returns any

Generated using TypeDoc