JSPM

node-video

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q12904F
  • License MIT

node paly video/audio

Package Exports

  • node-video

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-video) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-video

If your website can 't play video in Safari, you may need that.

Install

yarn add node-video -S

or 

npm i -S node-video

Options

  • root: 视频或者音频的根目录, 默认是 process.cwd().
  • extMatch: 请求路径的匹配规则,可以是 数组、正则(匹配资源的后缀名),默认是 ['.mp4', '.flv', '.webm', '.ogv', '.mpg', ".mpg", '.wav', '.ogg']

Example

const Koa = require('koa')
const nodeVideo = require('node-video')

const app = new Koa()

app.use(nodeVideo({
    extMatch: /\.mp[3-4]$/i
}))