smi2vtt

0.1.1 • Public • Published

smi2vtt

Convert .smi to .vtt
(This module doesn't supported stylesheet)

Installation

$ npm install smi2vtt

Usage

server.js

const smi2vtt = require('smi2vtt')
const app = express()
 
app.get( '/smi/:filename', (req, res) => {
  // parse
  smi2vtt( req.params.filename )
  // send
  .then( data => {
    res.set( 'Content-Type', 'text/vtt' )
    res.send( data )
  })
})

index.html

<video width="100%" controls>
  <source src="video/01.mp4" type="video/mp4">
  <track src="smi/01.smi" kind="subtitles" srclang="ko" label="korean" default>
</video>

Package Sidebar

Install

npm i smi2vtt

Weekly Downloads

0

Version

0.1.1

License

none

Last publish

Collaborators

  • nupamore