├── .browserslistrc ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── babel.config.json ├── package.json ├── src ├── @types │ └── worker.d.ts ├── buffering │ ├── buffering-strategy.ts │ ├── pass-through.ts │ └── tick-based-throttling.ts ├── decoder │ ├── decoder.ts │ ├── decoding.worker.ts │ ├── window-decoder.ts │ ├── worker-decoder-events.ts │ └── worker-decoder.ts ├── demux │ └── demuxer.ts ├── event │ ├── eventemitter.ts │ └── events.ts ├── index.ts ├── mpegts │ ├── chunks.ts │ ├── h264.ts │ ├── packet-chunker.ts │ ├── packet.ts │ ├── pes-decoder.ts │ ├── pes.ts │ ├── section-decoder.ts │ └── section.ts ├── player │ ├── pass-through-player.ts │ └── player.ts ├── source │ ├── http-streaming-window-source.ts │ ├── http-streaming-worker-events.ts │ ├── http-streaming-worker-source.ts │ ├── http-streaming.worker.ts │ ├── quic-datagram-rtpfec-window-source.ts │ └── source.ts ├── ticker │ ├── ticker-events.ts │ └── ticker.worker.ts └── util │ └── bitstream.ts ├── tsconfig.json ├── webpack.config.js └── yarn.lock /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 0.25% 2 | last 2 versions 3 | not ie <= 8 4 | ie 11 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | d.ts/ 5 | npm-debug.log* 6 | yarn-debug.log* 7 | yarn-error.log* 8 | 9 | .node-version -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | 7 | .node-version -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 もにょ~ん 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # zlplayer [![npm](https://img.shields.io/npm/v/zlplayer.svg?style=flat)](https://www.npmjs.com/package/zlplayer) 2 | 3 | HTML5 MPEG2-TS live stream player written in TypeScript. 4 | 5 | ## Overview 6 | 7 | zlplayer works by decoding MPEG2-TS stream into VideoFrame/AudioData using [WebCodecs](https://www.w3.org/TR/webcodecs/), 8 | followed by feeding into an an HTML5 `