npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@twick/video-editor

v0.14.18

Published

A React component for video editing and timeline management with advanced features.

Downloads

1,719

Readme

@twick/video-editor

A React component for video editing and timeline management with advanced features.

Overview

This package provides a comprehensive video editing interface with timeline management, multi-track support, and real-time preview capabilities. It integrates seamlessly with other Twick packages to create a complete video editing solution.

Features

  • Video preview with custom controls
  • Timeline-based editing interface
  • Multi-track timeline support
  • Customizable video dimensions
  • Drag-and-drop timeline reordering
  • High-performance video rendering
  • Real-time project updates
  • Advanced timeline manipulation
  • Professional editing tools

Requirements

  • React 18 or higher
  • Browser environment with HTML5 Video support

Installation

npm install @twick/video-editor
# or
pnpm add @twick/video-editor

Quick Start

import { VideoEditor } from '@twick/video-editor';
import { LivePlayerProvider } from '@twick/live-player';
import { TimelineProvider } from '@twick/timeline';

function App() {
  return (
    <LivePlayerProvider>
      <TimelineProvider
        initialData={{
          timeline: [],
          version: 0,
        }}
      >
        <VideoEditor
          leftPanel={null}
          rightPanel={null}
          editorConfig={{
            videoProps: {
              width: 720,
              height: 1280,
            },
            // Optional: Customize timeline tick marks
            timelineTickConfigs: [
              { durationThreshold: 30, majorInterval: 5, minorTicks: 5 },
              { durationThreshold: 300, majorInterval: 30, minorTicks: 6 }
            ],
            // Optional: Customize zoom behavior
            timelineZoomConfig: {
              min: 0.5, max: 2.0, step: 0.25, default: 1.0
            },
            // Optional: Customize element colors
            elementColors: {
              video: "#8B5FBF",
              audio: "#3D8B8B",
              image: "#D4956C",
              text: "#A78EC8",
              caption: "#9B8ACE",
              fragment: "#1A1A1A"
            }
          }}
        />
      </TimelineProvider>
    </LivePlayerProvider>
  );
}

Key Features

Video Preview

  • Real-time video playback with custom controls
  • Frame-accurate timeline scrubbing
  • Multiple preview quality options
  • Responsive video display

Timeline Management

  • Multi-track timeline interface
  • Drag-and-drop element reordering
  • Visual timeline representation
  • Time-based element positioning

Editing Tools

  • Text overlay capabilities
  • Image and video element support
  • Audio track management
  • Effect and transition tools

Performance

  • Optimized rendering pipeline
  • Efficient memory management
  • Smooth playback performance
  • Real-time updates

API Reference

Components

  • VideoEditor: Main video editor component

Props

  • leftPanel: Custom left panel component
  • rightPanel: Custom right panel component
  • bottomPanel: Custom bottom panel component
  • editorConfig: Editor configuration object
  • defaultPlayControls: Whether to show default playback controls

Configuration Options

editorConfig

interface VideoEditorConfig {
  videoProps: {
    width: number;
    height: number;
    backgroundColor?: string;
  };
  playerProps?: {
    quality?: number;
    maxWidth?: number;
    maxHeight?: number;
  };
  canvasMode?: boolean;
  timelineTickConfigs?: TimelineTickConfig[];
  timelineZoomConfig?: TimelineZoomConfig;
  elementColors?: ElementColors;
}

Timeline Tick Configuration

Customize timeline tick marks for different duration ranges:

interface TimelineTickConfig {
  durationThreshold: number; // Applies when duration < threshold
  majorInterval: number;      // Major tick interval in seconds
  minorTicks: number;         // Number of minor ticks between majors
}

Example:

timelineTickConfigs: [
  { durationThreshold: 30, majorInterval: 5, minorTicks: 5 },    // < 30s
  { durationThreshold: 300, majorInterval: 30, minorTicks: 6 },  // < 5min
  { durationThreshold: 3600, majorInterval: 300, minorTicks: 5 } // < 1hr
]

Zoom Configuration

Customize timeline zoom behavior:

interface TimelineZoomConfig {
  min: number;     // Minimum zoom level
  max: number;     // Maximum zoom level
  step: number;    // Zoom step increment/decrement
  default: number; // Default zoom level
}

Example:

timelineZoomConfig: {
  min: 0.5,     // 50% minimum zoom
  max: 3.0,     // 300% maximum zoom
  step: 0.25,   // 25% zoom steps
  default: 1.5  // 150% default zoom
}

Element Colors

Customize timeline element colors:

interface ElementColors {
  video: string;
  audio: string;
  image: string;
  text: string;
  caption: string;
  fragment: string;
}

Example:

elementColors: {
  video: "#8B5FBF",
  audio: "#3D8B8B",
  image: "#D4956C",
  text: "#A78EC8",
  caption: "#9B8ACE",
  fragment: "#1A1A1A"
}

Default Constants

The package exports default configurations that can be used or customized:

import { 
  DEFAULT_TIMELINE_TICK_CONFIGS,
  DEFAULT_TIMELINE_ZOOM_CONFIG,
  DEFAULT_ELEMENT_COLORS
} from '@twick/video-editor';

// Use defaults
<VideoEditor
  editorConfig={{
    videoProps: { width: 1920, height: 1080 },
    timelineTickConfigs: DEFAULT_TIMELINE_TICK_CONFIGS,
    timelineZoomConfig: DEFAULT_TIMELINE_ZOOM_CONFIG,
    elementColors: DEFAULT_ELEMENT_COLORS
  }}
/>

// Or customize based on defaults
const customColors = {
  ...DEFAULT_ELEMENT_COLORS,
  video: "#FF0000",  // Custom red for video
  audio: "#00FF00"   // Custom green for audio
};

Types

  • VideoEditorProps: Props interface for VideoEditor
  • VideoEditorConfig: Editor configuration interface
  • TimelineTickConfig: Timeline tick configuration interface
  • TimelineZoomConfig: Zoom configuration interface
  • ElementColors: Element colors interface

For complete API documentation, refer to the generated documentation.

Browser Support

This package requires a browser environment with support for:

  • HTML5 Video and Audio
  • Canvas API
  • Drag and Drop API
  • Modern JavaScript features (ES2020+)

Documentation

For complete documentation, refer to the project documentation site.

License

This package is licensed under the Sustainable Use License (SUL) Version 1.0.

  • Free for use in commercial and non-commercial apps
  • Can be modified and self-hosted
  • Cannot be sold, rebranded, or distributed as a standalone SDK

For commercial licensing inquiries, contact: [email protected]

For full license terms, see the main LICENSE.md file in the project root.