1.1.1 • Published 3 days ago

diagnal-web-player v1.1.1

Weekly downloads
-
License
-
Repository
github
Last release
3 days ago

Documentation

Diagnal web player

The internal Diagnal web player

install

npm i diagnal-web-player

using as submodule

go to the directory where you want to use this module e.g player and run the following command

git submodule add https://github.com/diagnal/diagnal-webplayer

Basic Example

somewhere in your HTML file

<div id="dplayer" />
import {
  DPlayer,
  Shaka,
  Bitmovin,
  videoEvents,
  coreEvents
  DOMUtils,
  basicPlugin,
} from 'diagnal-web-player'

// register events
const events = {
  [BitmovinEvents.timechanged]: (data) => {
    log('time updated', data)
  },
}

// config for core and wrapper player
const playerConfig = {
  events,
  plugins: [basicPlugin],
  wrapperEvents: BitmovinEvents,
  profile: true,
  bitmovinConfig: {
    sdkUrl: 'https://cdn.bitmovin.com/player/web/8/bitmovinplayer.js',
    playerConfig: {
      key: process.env.BITMOVIN_API_KEY,
      ui: false,
      style: {
        aspectratio: '2:1',
      },
      tweaks: {
        file_protocol: true,
        app_id: process.env.APP_ID,
      },
      playback: {
        autoplay: true,
      },
    },

    sourceConfig: {
      title: 'Default Demo Source Config',
      description: 'Select another example in "Step 4 - Load a Source" to test it here',
      dash: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd',
      hls: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8',
      smooth:
        'https://test.playready.microsoft.com/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/manifest',
      progressive:
        'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/MI201109210084_mpeg-4_hd_high_1080p25_10mbits.mp4',
      poster: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/poster.jpg',
    },
  },
}

// create the player
const player = DPlayer.createPlayer(Bitmovin, playerConfig)

// use the player api
global.onload = () => {
  on('#play:click', () => player.play())
  on('#pause:click', () => player.pause())
}

submodule import example

import {
  DPlayer,
  Shaka,
  Bitmovin,
  videoEvents,
  coreEvents
  DOMUtils,
  basicPlugin,
} from 'diagnal-web-player'
1.1.1

3 days ago

1.1.0

2 months ago

1.0.99

2 months ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago