Options
All
  • Public
  • Public/Protected
  • All
Menu

The Cutlistplayer is used to preview subclips from a video file. This player uses progressive download as streaming technology.

Example:


// Select all video elements from the dom.
const videoNodes = document.getElementsByTagName("video");
const videos: HTMLVideoElement[] = [];

// Hide all video elements initially and add to array structure.
for (let i = 0; i < videos.length; i++) {
  videoNodes.item(i).style.display = "none";
  videos.push(videoNodes.item(i));
}

// Create and instantiate the player object.
const cutlistPlayer = new CutlistPlayer(videos, KEY);

// Define a cutlist
const cutList: Cut[] = [
  {
    // The start and end is a frame number relative to the original video file.
    start: 0,
    end: 36
  },
 {
    // In order to include a clip from a separate video file, add a custom src to the clip.
    src: "myOtherVideo.mp4"
    start: 240,
    end: 360
  },
];

// Register event listeners to react to which video element is playing and set display value accordingly.
cutlistPlayer.addEventListener(
  CutlistPlayerEventName.CutChange,
  (ev: CutChangedEvent) => {
    if (ev.previousVideo) {
      ev.previousVideo.style.display = "none";
    }
    ev.currentVideo.style.display = "block";
  });

Hierarchy

  • Player
    • CutlistPlayer

Index

Constructors

constructor

  • Parameters

    Returns CutlistPlayer

Properties

_internalEventBus

_internalEventBus: EventMixin

Internal event bus.

Readonly api

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