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

1.2.25 • Public • Published

oplayer-plugin-dash

npm npm bundle size npm dm jsdelivr

MPEG DASH plugin for oplayer

Install

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

<div id="oplayer" />

<script>
  OPlayer.make('#oplayer', {
    source: {
      src: 'https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd',
      poster: 'https://cdn.jsdelivr.net/gh/shiyiya/QI-ABSL@master/o/poster.png'
    }
  })
    .use([ODash()])
    .create()
</script>

Usage

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

// active inactive
export type Active = (
  instance: MediaPlayerClass,
  library: typeof import('dashjs')
) => void | ((instance: MediaPlayerClass, library: typeof import('dashjs')) => void)

export interface DashPluginOptions {
  matcher?: Matcher
  active?: Active
  /**
   * config for dashjs
   *
   * @type {MediaPlayerSettingClass}
   */
  config?: MediaPlayerSettingClass
  /**
   * enable quality control for the stream, does not apply to the native (iPhone) clients.
   * @default: true
   */
  qualityControl?: boolean
  /**
   *  control how the stream quality is switched. default: immediate
   *  @value immediate: Trigger an immediate quality level switch to new quality level. This will abort the current fragment request if any, flush the whole buffer, and fetch fragment matching with current position and requested quality level.
   *  @value smooth: Trigger a quality level switch for next fragment. This could eventually flush already buffered next fragment.
   */
  qualitySwitch?: 'immediate' | 'smooth'
  /**
   * @default: false
   */
  withBitrate?: boolean
  /**
   * @default: true
   */
  audioControl?: boolean
  /**
   * @default: true
   */
  textControl?: boolean
}

Readme

Keywords

Package Sidebar

Install

npm i @oplayer/dash

Weekly Downloads

84

Version

1.2.25

License

MIT

Unpacked Size

27 kB

Total Files

8

Last publish

Collaborators

  • isbailin