Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CutlistPlayer

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

  • any
    • CutlistPlayer

Index

Constructors

Properties

Constructors

constructor

  • Parameters

    • slaves: HTMLVideoElement[]
    • key: string
    • Optional settings: Partial<PlayerSettings>

    Returns CutlistPlayer

Properties

api

version

version: string = `${playerInfo.name}:${playerInfo.version}`