@oplayer/mpegts
TypeScript icon, indicating that this package has built-in type declarations

1.2.23 • Public • Published

oplayer-plugin-mpegts

npm npm bundle size npm dm jsdelivr

FLV plugin for oplayer

Install

npm i @oplayer/core @oplayer/mpegts mpegts.js
<script src="https://cdn.jsdelivr.net/npm/@oplayer/core@latest/dist/index.min.js"></script>
<!--  mpegts FIRST  -->
<script src="https://cdn.jsdelivr.net/npm/mpegts.js@latest/dist/mpegts.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@oplayer/mpegts@latest/dist/index.min.js"></script>

<div id="oplayer" />

<script>
  OPlayer.make('#oplayer', {
    source: {
      src: 'http://example.com/live/livestream.ts',
      poster: 'https://oplayer.vercel.app/poster.png'
    }
  })
    .use([OMpegts()])
    .create()
</script>

Usage

export type Matcher = (video: HTMLVideoElement, source: Source) => boolean

// active inactive
export type Active = (
  instance: Mpegts.Player,
  library: typeof Mpegts
) => void | ((instance: Mpegts.Player, library: typeof Mpegts) => void)

export type MpegtsPluginOptions = {
  config?: Partial<Mpegts.Config>
  matcher?: Matcher
  active?: Active
}

Package Sidebar

Install

npm i @oplayer/mpegts

Weekly Downloads

10

Version

1.2.23

License

MIT

Unpacked Size

13.3 kB

Total Files

9

Last publish

Collaborators

  • isbailin