Point Plugin

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 (view full)

Constructors

Properties

name: string
Name: string = POINT_PLUGIN_NAME

Accessors

  • get loaded(): 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.

    Returns boolean

  • set loaded(loaded): void
  • Parameters

    • loaded: boolean

    Returns void

  • get muted(): 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.

    Returns boolean

  • set muted(muted): void
  • Parameters

    • muted: boolean

    Returns void

  • get points(): {
        in?: Point;
        out?: Point;
    }
  • Gets the current points, or undefined if not set.

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

    The current points.

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

    Returns string

Methods

  • Adds an event listener for a specific event.

    Parameters

    • type: string

      Event type.

    • callback: Listener

      Listener callback function.

    Returns void

  • Clear the current in point and triggers changed event.

    Returns void

  • Clear the current out point and triggers changed event.

    Returns void

  • Clear the current points and triggers changed event.

    Returns void

  • Unregisters itself with the player and removes all internal and external event listeners.

    Returns void

  • Plugin actions are optional and by default a plugin does not contain any actions.

    Returns PluginAction[]

  • Alias method for removeEventListener.

    Parameters

    • type: string

      Event type.

    • callback: Listener

      Listener callback function.

    Returns void

  • Alias method for addEventListener.

    Parameters

    • type: string

      Event type.

    • callback: Listener

      Listener callback function.

    Returns void

  • Removes an event listener for a specific event.

    Parameters

    • type: string

      Event type.

    • callback: Listener

      Listener callback function.

    Returns void

  • Sets the current frame as in point.

    Returns 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

  • Sets the current frame as out point.

    Returns 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

  • 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