chimee-kernel-hls

Build StatusCoverage Statusnpmdependency StatusdevDependency Status

chimee-kernel-hls is the decoder for chimee. It can decode m3u8 on browser.

It's based on hls.js.

It totally fit the requirement of chimee-kernel.

It should only be used in the PC, as most of mobile browser support m3u8.

Installation

  1. npm install --save chimee-kernel-hls

Usage

You can use chimee-kernel-hls in chimee or chimee-player like this.

  1. import Chimee from 'chimee';
  2. import ChimeeKernelHls from 'chimee-kernel-hls';
  3. const chimee = new Chimee({
  4. wrapper: '#wrapper',
  5. src: 'http://cdn.toxicjohann.com/lostStar.mp4',
  6. controls: true,
  7. autoplay: true,
  8. kernels: {
  9. hls: ChimeeKernelHls,
  10. }
  11. });
  12. chimee.play();

We also support custom config on hls.js, such as config describe in the document.

  1. import Chimee from 'chimee';
  2. import ChimeeKernelHls from 'chimee-kernel-hls';
  3. const chimee = new Chimee({
  4. wrapper: '#wrapper',
  5. src: 'http://cdn.toxicjohann.com/lostStar.mp4',
  6. controls: true,
  7. autoplay: true,
  8. kernels: {
  9. hls: {
  10. handler: ChimeeKernelHls,
  11. debug: true,
  12. }
  13. }
  14. });
  15. chimee.play();