0.3.9 • Published 4 years ago

react-timeline-editor v0.3.9

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

react-timeline-editor

React Timeline adjustment

Install

npm i react-timeline-editor

Demo

see

Usage

import React from "react";
import Timeline from "react-timeline-editor";

function App() {
  const audioRef = useRef(); //access audio/video element.
  const data = [{ begin: 25, end: 35, text: "This is subtitle" }];

  return (
    <div>
      <button onClick={() => audioRef.current.play()}>play</button>
      <button onClick={() => audioRef.current.pause()}>pause</button>

      <Timelines
        changeAreaShow={(start, end) => {}}
        changeZoomLevel={(zoomLevel) => {}}
        changeShift={(shift) => {}}
        setAligns={(alignments) => {}}
        audioRef={audioRef}
        src={"..."}
        data={data}
        autoScroll
        colors={{
          background: "transparent",
          box: "#a9a9a9",
          boxHover: "#80add6",
          selectedBox: "#1890ff",
          playingBox: "#f0523f",
          text: "#212b33",
          selectedText: "white",
          tooltipBackground: "#474e54",
          tooltipText: "white",
          scrollBarBackground: "#f1f3f9",
          scrollBar: "#c2c9d6",
          scrollBarHover: "#8f96a3",
        }}
      />
    </div>
  );
}

Props

PropTypeDescription
paddingLeftNumberpadding left.
paddingRightNumberpadding right.
data{ begin: Number, end: Number, text: String }Alignments data (begin and end unit is second).
srcStringVideo or audio source.
audioRefReact.RefObjectVideo or audio ref.
changeAreaShowFunctionCallback when viewport changed.
changeZoomLevelFunctionCallback when zoom level changed.
changeShiftFunctionCallback when shift changed.
setAlignsFunctionCallback when data times changed.
colorsObjectColors object (see example).

Others props will be ready soon.

Contributing

coming soon

0.3.9

4 years ago

0.3.0

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.8

4 years ago

0.2.9

4 years ago

0.3.7

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.2.8

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago