0.1.1 • Published 7 years ago

smi2vtt v0.1.1

Weekly downloads
2
License
-
Repository
github
Last release
7 years ago

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>