Options
All
  • Public
  • Public/Protected
  • All
Menu

This service is a api layer that handles the communication with the video element regarding playback.

Note This service is created by the HlsPlayer on startup and should never be instantiated elsewhere.

Hierarchy

  • Service
    • ProgressiveService

Index

Constructors

constructor

  • new ProgressiveService(master: HTMLVideoElement, eventCallback: <T>(event: T) => void, internalEventBus: EventMixin, settings?: PlayerSettings): ProgressiveService
  • Note Should only be used from within the player.

    Parameters

    • master: HTMLVideoElement

      The video element.

    • eventCallback: <T>(event: T) => void

      Callback to control internal event handling.

        • <T>(event: T): void
        • Type parameters

          • T: PlayerEvent

          Parameters

          • event: T

          Returns void

    • internalEventBus: EventMixin

      Event bus for internal communication.

    • Optional settings: PlayerSettings

      Basic settings controlling the behavior.

    Returns ProgressiveService

Properties

playbackRates

playbackRates: number[] = ...

plugin

plugin: PluginApi

An object containing all currently registered plugins. Access a specific plugin using the Plugins static property Name, i.e. plugin[Plugin.Name].

Accessors

isLooping

  • get isLooping(): boolean
  • Returns boolean

isSeeking

  • get isSeeking(): boolean
  • Returns true if a seek is in progress, false otherwise

    Returns boolean

loaded

  • get loaded(): boolean
  • Player and plugins, if any, are ready for continued playback.

    Returns boolean

master

  • get master(): HTMLMediaElement
  • Returns HTMLMediaElement

maximumPlaybackRate

  • get maximumPlaybackRate(): number
  • The maximum acceptable value for playback rate.

    Returns number

    The maximum value.

minimumPlaybackRate

  • get minimumPlaybackRate(): number
  • The minimum acceptable value for playback rate.

    Returns number

    The minimum value.

muted

  • get muted(): boolean
  • Player and plugins, if any, are all muted.

    Returns boolean

playbackRateIncrements

  • get playbackRateIncrements(): number[]
  • Returns a list of playback rates that are used when increasing or decreasing playback rate.

    Returns number[]

Methods

cancelLoop

  • cancelLoop(): void
  • Cancels loop playback.

    Returns void

decreasePlaybackRate

  • decreasePlaybackRate(): void
  • Decreases the current playback rate based on predefined steps.

    Returns void

destroy

  • destroy(): Promise<void>
  • Destroys the service, should only be called from within the player.

    Returns Promise<void>

getActiveFile

  • getActiveFile(): VideoFile
  • Returns the active video file or undefined if no video file is loaded.

    Returns VideoFile

getCurrentTime

  • getCurrentTime(format?: TimeFormat): string | number
  • Parameters

    • Optional format: TimeFormat

    Returns string | number

getDuration

  • getDuration(format?: TimeFormat): string | number
  • Parameters

    • Optional format: TimeFormat

    Returns string | number

getStatus

  • getStatus(): PlayerStatus
  • Returns PlayerStatus

increasePlaybackRate

  • increasePlaybackRate(): void
  • Increases the current playback rate based on predefined steps.

    Returns void

listPlugins

  • listPlugins(): Plugin[]
  • Returns a list of all registered plugins.

    Returns Plugin[]

loadVideoFile

  • loadVideoFile(videoFile: VideoFile): void
  • Parameters

    • videoFile: VideoFile

    Returns void

loadVideoFiles

  • loadVideoFiles(files: VideoFile[]): void
  • Load videoFiles i.e multiple representations of the same video.

    Parameters

    • files: VideoFile[]

      The files to be loaded.

    Returns void

loop

  • loop(inFrame: number, outFrame: number): void
  • Loop section of loaded Video.

    Parameters

    • inFrame: number

      inclusive

    • outFrame: number

      exclusive

    Returns void

mute

  • mute(): void
  • Mutes the player.

    Returns void

muteMuxed

  • muteMuxed(): void
  • Mutes the muxed audio

    Returns void

onPlayerStatusChanged

  • onPlayerStatusChanged(): void
  • Helper method to make sure that playback is resumed correctly. Should only be used from within the player.

    Returns void

pause

  • pause(pauseOn?: SeekEvent, userPause?: boolean): Promise<void>
  • Pauses playback and makes sure that the player is stopped at an exact frame.

    Parameters

    • Optional pauseOn: SeekEvent

      (Optional) Seek to specific time when pausing.

    • Optional userPause: boolean

    Returns Promise<void>

play

  • play(): Promise<void>
  • Starts playback. Queues requests if the player is seeking or loading to achieve autoplay behavior.

    Returns Promise<void>

seek

  • seek(event: SeekEvent, roundingMode?: RoundingMode): Promise<void>
  • Parameters

    • event: SeekEvent
    • Optional roundingMode: RoundingMode

    Returns Promise<void>

setFrameOffset

  • setFrameOffset(offset: number): void
  • Update frameOffset value for all loaded videoFiles. Equivalent to load videoFile with a specific frameOffset.

    Parameters

    • offset: number

      Frame offset to set.

    Returns void

setPlaybackRate

  • setPlaybackRate(rate: number): number
  • Sets the playback rate. Limited to predefined min- and max values.

    Parameters

    • rate: number

      The new playback rate

    Returns number

setVolume

  • setVolume(volume: number): void
  • Set the volume of the player.

    Parameters

    • volume: number

      A number between 0 and 1.

    Returns void

setVolumeController

  • setVolumeController(volumeController: VolumeController): void
  • Sets the default controller for the volume

    Parameters

    • volumeController: VolumeController

      the volume controller

    Returns void

switchVideoFile

  • switchVideoFile(file: VideoFile): void
  • Switch between already loaded video files i.e representations of the same video. The file must be with the 'loadVideoFiles' method.

    Parameters

    • file: VideoFile

      The desired representation.

    Returns void

toggleMute

  • toggleMute(): void
  • Toggles mute.

    Returns void

toggleMuteMuxed

  • toggleMuteMuxed(): void
  • Toggles mute on the muxed audio

    Returns void

togglePlay

  • togglePlay(): Promise<void>
  • Toggles playback.

    Returns Promise<void>

unmute

  • unmute(): void
  • Unmutes the player.

    Returns void

unmuteMuxed

  • unmuteMuxed(): void
  • Unmutes the muxed audio

    Returns void

updateVideoFile

  • updateVideoFile(videoFile: VideoFile): void
  • Parameters

    • videoFile: VideoFile

    Returns void

useDropFrame

  • useDropFrame(dropFrame: boolean): void
  • Update the dropFrame value for all loaded videoFiles. Equivalent to load videoFile with dropFrame property set.

    Parameters

    • dropFrame: boolean

      Drop frame value to set.

    Returns void