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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-video-editor-timeline

v1.0.0

Published

A customizable video and audio timeline component for React projects

Downloads

15

Readme

React Video Editor Timeline

A customizable video and audio timeline component for React projects. This component allows you to integrate and control video and audio playback, and provides a flexible timeline for visual representation. You can also customize the timeline's appearance and add context menus with custom actions.

Features

  • Video and Audio Integration: Sync video and audio playback with a unified timeline.
  • Customizable Styles: Adjust the timeline and controls to match your project's design.
  • Context Menus: Add custom context menus for additional functionality on the timeline.
  • Flexible API: Pass menus, actions, and styles as props to tailor the component to your needs.

Installation

To install the react-video-editor-timeline package, use npm or yarn:

npm install react-video-editor-timeline

or

yarn add react-video-editor-timeline

Usage

Here is a basic example of how to use the VideoEditorTimeline component in your React project.

src/App.js

import React from 'react';
import VideoEditorTimeline from 'react-video-editor-timeline';
import { Menu, message } from 'antd';
import { VideoCameraOutlined, SoundOutlined, PlayCircleOutlined, PauseCircleOutlined, RedoOutlined } from '@ant-design/icons';

const videoMenu = (
  <Menu>
    <Menu.Item onClick={() => message.info('Edit Video')}>
      Edit Video
    </Menu.Item>
    <Menu.Item onClick={() => message.info('Delete Video')}>
      Delete Video
    </Menu.Item>
  </Menu>
);

const audioMenu = (
  <Menu>
    <Menu.Item onClick={() => message.info('Edit Audio')}>
      Edit Audio
    </Menu.Item>
    <Menu.Item onClick={() => message.info('Delete Audio')}>
      Delete Audio
    </Menu.Item>
  </Menu>
);

function App() {
  return (
    <div className="App">
      <VideoEditorTimeline
        videoURL="your-video-url.mp4"
        audioURL="your-audio-url.mp3"
        customStyles={{
          container: { backgroundColor: '#fff' },
          videoContainer: { padding: '20px' },
          videoWrapper: { borderRadius: '10px', overflow: 'hidden' },
          videoElement: { width: '100%' },
          playPauseButton: { marginRight: '10px' },
          restartButton: { marginRight: '10px' },
          timelineContainer: { marginTop: '20px' },
          combinedTimeline: { position: 'relative', height: '50px' },
          timelineShadow: { boxShadow: '0 2px 4px rgba(0, 0, 0, 0.2)' },
          timelineIcons: { display: 'flex', alignItems: 'center' },
          timelineDuration: { marginLeft: '10px' },
          timelineBars: { display: 'flex', alignItems: 'center' },
          videoTimeline: { height: '10px', position: 'relative' },
          videoBarColor: '#a0d911',
          videoIndicatorColor: '#ff4d4f',
          audioTimeline: { height: '10px', position: 'relative' },
          audioBarColor: '#69c0ff',
          audioIndicatorColor: '#0050b3',
          timelineDivider: { margin: '10px 0' },
        }}
        customIcons={{
          video: <VideoCameraOutlined style={{ fontSize: '24px', color: '#1890ff' }} />,
          audio: <SoundOutlined style={{ fontSize: '24px', color: '#1890ff' }} />,
          play: <PlayCircleOutlined />,
          pause: <PauseCircleOutlined />,
          restart: <RedoOutlined />,
        }}
        videoMenu={videoMenu}
        audioMenu={audioMenu}
      />
    </div>
  );
}

export default App;

Props

videoURL (string)

  • Description: URL of the video to be played.
  • Required: Yes

audioURL (string)

  • Description: URL of the audio to be played.
  • Required: No

customStyles (object)

  • Description: Custom styles for the component. Use this to adjust the appearance of different parts of the component.
  • Required: No

customIcons (object)

  • Description: Custom icons for different buttons.
  • Required: No

videoMenu (ReactNode)

  • Description: Custom context menu for the video timeline.
  • Required: No

audioMenu (ReactNode)

  • Description: Custom context menu for the audio timeline.
  • Required: No

Development

To develop or contribute to this project, clone the repository and install the dependencies:

git clone https://github.com/akshay-092/react-video-editor-timeline.git
cd react-video-editor-timeline
npm install

To run the development server:

npm start

To build the project:

npm run build

To run tests:

npm test

To lint the code:

npm run lint