JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q32281F
  • License MIT

An extremely low latency MPEG2-TS player

Package Exports

  • zlplayer
  • zlplayer/dist/zlplayer.js

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 (zlplayer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

zlplayer npm

HTML5 MPEG2-TS live stream player written in TypeScript.

Overview

zlplayer works by decoding MPEG2-TS stream into VideoFrame/AudioData using WebCodecs,
followed by feeding into an an HTML5 <video> element through MediaStreamTrack Insertable Streams (a.k.a. Breakout Box).

Feature

  • Playback for MPEG2-TS stream with H.264 + AAC codec transported in http(s)
  • Extremely low latency of less than 0.1 second in the best case

Installation

npm install --save zlplayer

or

yarn add zlplayer

Build

yarn
yarn build

Getting Started

<script src="zlplayer"></script>
<video id="videoElement"></video>
<script>
  var videoElement = document.getElementById('videoElement');
  var zlplayer = new window.zlplayer.Player({
    // some options
  });
  zlplayer.attachMedia(videoElement);
  zlplayer.load(/* url */).then(() => {
    videoElement.play()
  });
</script>