0.1.3 • Published 3 years ago

kaldiras v0.1.3

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

Kaldiras

Kaldiras is a video player for ReactJS. Simple, accessible, and easy to customize.

Features

  • Accessible, full support for VTT captions
  • Customizable, change the color theming easily
  • Fullscreen, supports native fullscreen
  • Shortcut, supports keyboard shortcuts
  • Playsinline, supports the playsinline attribute
  • Playback Speed, adjust playback speed
  • Multiple captions, support for multiple caption tracks
  • Preview thumbnails, support for displaying preview thumbnails

How to install

npm install kaldiras

or

yarn add kaldiras

How to use

For now, Kaldiras supported video types like mp4, webm, mov, and ogg. You must set the video type on the source property and the quality size of the video.

The other property like subtitles and previews is optional. Just the source property is required.

import "kaldiras/kaldiras.css";
import { Video } from "kaldiras";

const App = () => {
  return(
    <Video
    sources={[
      {
        source: "https://.../480p.mp4",
        type: "video/mp4",
        resolution: "1080"
      }
    ]}
    subtitles={[
      {
        label: "English",
        lang: "en",
        source: "https://.../en.vtt",
        default: true
      }
    ]}
    previews={[
      {
        source: "https://.../5s.png",
        time: "0:05"
      }
    ]} />
  )
}

sources

Here will be explained the structure that exists in the sources property:

keytypedescription
sourcestringFill with the video url here.
typevideo/mp4, video/webm, video/ogg, video/quicktimeSet the video format.
resolution360, 480, 576, 720, 1080, 1440, 2160Set the video resolution.
defaultbooleanSet the video with what resolution to display by default.

subtitles

Here will be explained the structure that exists in the subtitles property:

keytypedescription
labelstringFill with the caption language
langstringFill with the caption language id
sourcestringFill with the caption url here.
defaultbooleanSet the default caption.

previews

This property is used to display a thumbnail preview when highlighting the progress bar. Here will be explained the structure that exists in the previews property:

keytypedescription
sourcestringFill with the image url here.
timestringFill the time when the thumbnail shows, with a format m:ss.

License

MIT © Yudha Pratama Wicaksana