Options
All
  • Public
  • Public/Protected
  • All
Menu

A plugin that adds support for setting frame accurate in- and out points. These can then be used in your application for creating time related metadata.

  • Defines functions for setting, clearing and seeking to points.
  • Includes hotkey support for its actions if HotkeyPlugin is used.
  • Emits events through player when points are added or removed.

How to use

const player = new ProgressivePlayer(...);
const pointPlugin = new PointPlugin(player);

// Register HotkeyPlugin
const hotkeyPlugin = new HotkeyPlugin(player);
 // Predefined hotkeys are ready to use.

How to register a custom point validator

It is possible to pass a custom PointValidator callback to the constructor of the plugin. The validator is used to limit points for a certain set of rules.

The callback will be triggered every time a point is added, the argument "eventCallback" can be used to trigger custom events on the Plugin/player to tell the user why the point addition failed.

Example:
If we want to prevent the user from adding outPoints, we could do a simple callback

...
const pointPlugin = new PointPlugin(player, false, (points, eventCallback) => {
 // If the user attempts to add an out point.
 if(points.out) {
   // Trigger an event with appropriate error message.
   eventCallback(new PointValidationFailedEvent("Not allowed to add out point!"));
   // Return false to cancel point addition.
   return false;
 }

 // Return true to continue the point addition.
 return true;
});

Hierarchy

Index

Constructors

constructor

Properties

Readonly name

name: string

Static Name

Name: string = ...

Accessors

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

points

  • Gets the current points, or undefined if not set.

    Returns { in?: Point; out?: Point }

    The current points.

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

clearInPoint

  • clearInPoint(): void
  • Clear the current in point and triggers changed event.

    Returns void

clearOutPoint

  • clearOutPoint(): void
  • Clear the current out point and triggers changed event.

    Returns void

clearPoints

  • clearPoints(): void
  • Clear the current points and triggers changed event.

    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

setInPoint

  • setInPoint(): void
  • Sets the current frame as in point.

    Returns void

setInPointFrame

  • setInPointFrame(frame: number, frameRate: FrameRate): void
  • Sets the in point to given frame

    Parameters

    • frame: number

      frame number where to place the in point

    • frameRate: FrameRate

      the frame rate for the frame parameter

    Returns void

setOutPoint

  • setOutPoint(): void
  • Sets the current frame as out point.

    Returns void

setOutPointFrame

  • setOutPointFrame(frame: number, frameRate: FrameRate): void
  • Sets the out point to given frame

    Parameters

    • frame: number

      frame number where to place the out point

    • frameRate: FrameRate

      the frame rate for the frame parameter

    Returns void

setPoints

  • setPoints(inPoint: Point, outPoint: Point): void
  • Set points manually. Can be used as a "move operator".

    Parameters

    • inPoint: Point

      The new in point.

    • outPoint: Point

      The new out point

    Returns void