Options
All
  • Public
  • Public/Protected
  • All
Menu

This plugin is used to get more frequent time update events than the native video element can provide.

How to use

const player = new ProgressivePlayer(...);
const smoothTimeUpdatePlugin = new SmoothTimeUpdatePlugin(player);

// Add event listener to perform frequent updates.
smoothTimeUpdatePlugin.on(
 SmoothTimeUpdateEventType.TimeUpdate,
 (event: SmoothTimeUpdateEvent) => {
   // Update some visual element using the current frame value
   this.timeDisplay.setCurrentFrame(event.currentFrame);
 }
);

Disclaimer: The SmoothTimeUpdateEventType.TimeUpdate event is fired for each frame, but it is not guaranteed to be emitted at the exact time of the frame. So calling player.api.getCurrentTime(TimeFormat.Frame) might report a different frame than event.currentFrame.

Hierarchy

Index

Constructors

constructor

Properties

Readonly name

name: string

Static Name

Name: string = ...

Accessors

isRequestVideoFrameCallbackSupported

  • get isRequestVideoFrameCallbackSupported(): boolean
  • Returns boolean

loaded

  • get loaded(): boolean
  • set loaded(loaded: boolean): void
  • Property that states whether this plugin considers itself ready for continued playback based on internal logic. Triggers internal event of type PlayerInternalEventType.LoadedChanged if property value was changed.

    Returns boolean

  • Property that states whether this plugin considers itself ready for continued playback based on internal logic. Triggers internal event of type PlayerInternalEventType.LoadedChanged if property value was changed.

    Parameters

    • loaded: boolean

    Returns void

muted

  • get muted(): boolean
  • set muted(muted: boolean): void
  • Property that states whether this plugin considers itself muted based on internal logic. Triggers internal event of type PlayerInternalEventType.MutedChanged if property value was changed.

    Returns boolean

  • Property that states whether this plugin considers itself muted based on internal logic. Triggers internal event of type PlayerInternalEventType.MutedChanged if property value was changed.

    Parameters

    • muted: boolean

    Returns void

version

  • get version(): string
  • Property describing the plugin name and version.

    Returns string

Methods

addEventListener

  • addEventListener(type: string, callback: Listener): void
  • Adds an event listener for a specific event.

    Parameters

    • type: string

      Event type.

    • callback: Listener

      Listener callback function.

    Returns void

destroy

  • destroy(): void
  • Unregisters itself with the player and removes all internal and external event listeners.

    Returns void

getPluginActions

  • getPluginActions(): PluginAction[]
  • Plugin actions are optional and by default a plugin does not contain any actions.

    Returns PluginAction[]

off

  • off(type: string, callback: Listener): void
  • Alias method for removeEventListener.

    Parameters

    • type: string

      Event type.

    • callback: Listener

      Listener callback function.

    Returns void

on

  • on(type: string, callback: Listener): void
  • Alias method for addEventListener.

    Parameters

    • type: string

      Event type.

    • callback: Listener

      Listener callback function.

    Returns void

removeEventListener

  • removeEventListener(type: string, callback: Listener): void
  • Removes an event listener for a specific event.

    Parameters

    • type: string

      Event type.

    • callback: Listener

      Listener callback function.

    Returns void