|
| 1 | +# chimee-kernel-flv.js |
| 2 | + |
| 3 | +[](https://travis-ci.org/Chimeejs/chimee-kernel-flv.js.svg?branch=master) |
| 4 | +[](https://coveralls.io/github/Chimeejs/chimee-kernel-flv.js?branch=master) |
| 5 | +[](https://www.npmjs.com/package/chimee-kernel-flv.js) |
| 6 | +[](https://david-dm.org/Chimeejs/chimee-kernel-flv.js) |
| 7 | +[](https://david-dm.org/Chimeejs/chimee-kernel-flv.js?type=dev) |
| 8 | + |
| 9 | +chimee-kernel-flv.js is the decoder for [chimee](https://github.com/Chimeejs/chimee). It can decode m3u8 on browser. |
| 10 | + |
| 11 | +It's based on [flv.js.js](https://github.com/video-dev/flv.js.js). |
| 12 | + |
| 13 | +It totally fit the requirement of [chimee-kernel](https://github.com/Chimeejs/chimee-kernel). |
| 14 | + |
| 15 | +It should only be used in the PC, as most of mobile browser support m3u8. |
| 16 | + |
| 17 | +## Installation |
| 18 | +``` |
| 19 | +npm install --save chimee-kernel-flv.js |
| 20 | +``` |
| 21 | +## Usage |
| 22 | + |
| 23 | +You can use chimee-kernel-flv.js in chimee or chimee-player like this. |
| 24 | + |
| 25 | +```javascript |
| 26 | +import Chimee from 'chimee'; |
| 27 | +import ChimeeKernelFlvJs from 'chimee-kernel-flv.js'; |
| 28 | +const chimee = new Chimee({ |
| 29 | + wrapper: '#wrapper', |
| 30 | + src: 'http://cdn.toxicjohann.com/lostStar.mp4', |
| 31 | + controls: true, |
| 32 | + autoplay: true, |
| 33 | + kernels: { |
| 34 | + flv: ChimeeKernelFlvJs, |
| 35 | + } |
| 36 | +}); |
| 37 | +chimee.play(); |
| 38 | +``` |
| 39 | + |
| 40 | +We also support custom config on flv.js.js, such as config describe in the [document](https://github.com/Bilibili/flv.js/blob/master/docs/api.md). |
| 41 | + |
| 42 | +```Javascript |
| 43 | +import Chimee from 'chimee'; |
| 44 | +import ChimeeKernelFlvJs from 'chimee-kernel-flv.js'; |
| 45 | +const chimee = new Chimee({ |
| 46 | + wrapper: '#wrapper', |
| 47 | + src: 'http://cdn.toxicjohann.com/lostStar.mp4', |
| 48 | + controls: true, |
| 49 | + autoplay: true, |
| 50 | + kernels: { |
| 51 | + flv: { |
| 52 | + handler: ChimeeKernelFlvJs, |
| 53 | + lazyLoad: true, |
| 54 | + } |
| 55 | + } |
| 56 | +}); |
| 57 | +chimee.play(); |
| 58 | +``` |
0 commit comments