Skip to content

hls player, flv player , simple MSE player (hls & fmp4 & flv live) , functional style

Notifications You must be signed in to change notification settings

xiyuyizhi/vod-fp.js

Repository files navigation

vod-fp.js

features

  • hls with ts format

  • hls with fmp4 format

  • hls ts with AES-128 decrypt

  • abr

  • hls ts live with abr

  • http-flv live

  • websocket flv live

some notes

base usage

used in browser direct

<script src="https://cdn.jsdelivr.net/npm/vod-fp-player@latest/lib/vod-fp-player.min.js"></script>

used as module

npm install vod-fp-player --save

import Vod from "vod-fp-player"
const vod = new Vod({
  [Vod.Configs.MAX_BUFFER_LENGTH]: 60,
  [Vod.Configs.MAX_FLY_BUFFER_LENGTH]: 30,
});
const media = document.querySelector('video');

media.addEventListener('loadedmetadata', () => {
  media.play().catch((e) => {
    // not allowed auto play
  });
});

vod.attachMedia(media);

vod.loadSource('https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8');

vod.on(Vod.Events.ERROR, (e) => {
  // do someting when error occur
});

usage details

development

media asserts

git clone git@github.com:xiyuyizhi/vod-fp.js.git

npm install lerna -g

lerna bootstrap

npm run build:mux

npm run build:util

npm run build:player

npm run build:demo

npm run dev

npm run demo

About

hls player, flv player , simple MSE player (hls & fmp4 & flv live) , functional style

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published