duspada / react-native-subtitles

A package for adding subtitles to a video

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Native Subtitles · PRs Welcome

Add subtitles to any video given a current timestamp.

Table of Contents

Installation

$ npm i react-native-subtitles

Usage

import Subtitles from 'react-native-subtitles'

const Example = () => {
  return (
    <Subtitles
      {...{ currentTime }}
      selectedsubtitle={{
        file: 'https://bitdash-a.akamaihd.net/content/sintel/subtitles/subtitles_en.vtt',
      }}
    />
  )
}

Props

currentTime

Integer with the current time. It should change every second, yes. A common use case would be having a video an setting a state with the current time as it changes.

selectedsubtitle

An object with the file property containing the url. You can add more properties to this object, like name or lang, to use on the frontend for changing between each one.

containerStyle

The style for the container

textStyle

The style for the text

Credits

PRs are welcome!

About

A package for adding subtitles to a video


Languages

Language:TypeScript 97.2%Language:JavaScript 2.8%