Video.js tech for MPEG2-TS stream with mpegts.js
npm install videojs-mpegtsjsFor mpegts-js.
``sh`
npm install --save video.js mpegts.js videojs-mpegtsjs
You need to include video.js first.
videojs-mpegtsjs internally depends on mpegts.js, so there is no need to explicitly introduce mpegts.js.
`html`
`js
import videojs from 'video.js'
import 'videojs-mpegtsjs'
videojs('video-js-node', {
mpegtsjs: {
mediaDataSource: {
isLive: true,
cors: false,
withCredentials: false,
},
},
controls: 'control',
preload: 'auto',
height: '505',
})
``
[videojs]: http://videojs.com/
[mpegts.js]: https://github.com/xqq/mpegts.js
Apache-2.0. Copyright (c) Kewell