Options
All
  • Public
  • Public/Protected
  • All
Menu

ABR Player

This is a player that supports playback of DASH and HLS files and is based on shaka-player.

Shaka player comes with a lot of capabilities and functionallity. In order to take advantage of all features we provide access to the player instance through player.api.shakaInstance, additionally we expose some utility methods to configure the instance as well.

  • player.api.configureShaka() - wrapper to configure the shaka player instance.
  • player.api.registerRequestFilter() - wrapper to register a network interceptor for shaka.

DRM

Shaka player enables playback of DRM encoded content.

Hierarchy

  • Player
    • AbrPlayer

Index

Constructors

constructor

  • new AbrPlayer(master: HTMLVideoElement, key: string, settings?: Partial<AbrPlayerSettings>): AbrPlayer
  • Creates an instance.

    Parameters

    • master: HTMLVideoElement

      The video element that should load an HLS file.

    • key: string

      The licens key to Accurate Player

    • Optional settings: Partial<AbrPlayerSettings>

      Settings controlling some basic functionality of the player.

    Returns AbrPlayer

Properties

_internalEventBus

_internalEventBus: EventMixin

Internal event bus.

Readonly api

Contains methods controlling the playback.

master

master: HTMLVideoElement

Readonly version

version: string = ...

Accessors

about

  • get about(): string[]
  • Collects information about the player setup. Including versions for core, controller and all plugins.

    Returns string[]

Methods

addEventListener

  • addEventListener(type: string, callback: (...args: any[]) => void, once?: boolean): void
  • Adds an event listener for a specific event.

    Parameters

    • type: string

      Event type.

    • callback: (...args: any[]) => void

      Listener callback function.

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional once: boolean

      (Optional) Indicating that the listener should be invoked at most once after being added. If true, the listener would be automatically removed when invoked.

    Returns void

destroy

  • destroy(): Promise<void>
  • Destroys the player, service api layer and all registered plugins.

    Returns Promise<void>

emitEvent

  • emitEvent<T>(event: T): void
  • Emits a player event.

    Type parameters

    • T: PlayerEvent

    Parameters

    • event: T

      Event that contains at least a 'type' property.

    Returns void

getSettings

  • getSettings(): PlayerSettings
  • Returns the current settings for the player.

    Returns PlayerSettings

off

  • off(type: string, callback: (...args: any[]) => void): void
  • Alias method for removeEventListener.

    Parameters

    • type: string

      Event type.

    • callback: (...args: any[]) => void

      Listener callback function.

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

on

  • on(type: string, callback: (...args: any[]) => void, once?: boolean): void
  • Alias method for addEventListener.

    Parameters

    • type: string

      Event type.

    • callback: (...args: any[]) => void

      Listener callback function.

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional once: boolean

      (Optional) Indicating that the listener should be invoked at most once after being added. If true, the listener would be automatically removed when invoked.

    Returns void

registerPlugin

  • registerPlugin(plugin: Plugin): void
  • Registers a plugin if it doesn't already exist.

    Parameters

    • plugin: Plugin

      The plugin to register.

    Returns void

removeAllListeners

  • removeAllListeners(): void
  • Removes all listeners.

    Returns void

removeEventListener

  • removeEventListener(type: string, callback: (...args: any[]) => void): void
  • Removes an event listener for a specific event.

    Parameters

    • type: string

      Event type.

    • callback: (...args: any[]) => void

      Listener callback function.

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

unregisterPlugin

  • unregisterPlugin(plugin: Plugin): void
  • Unregisters a plugin if it exists.

    Parameters

    • plugin: Plugin

      The plugin to unregister.

    Returns void