JSPM

  • Created
  • Published
  • Downloads 45
  • Score
    100M100P100Q79041F
  • License MIT

a video plugin for white-web-sdk using video.js.

Package Exports

  • @netless/video-js-plugin

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@netless/video-js-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@netless/video-js-plugin

https://www.npmjs.com/package/@netless/video-js-plugin

Install

Note: video.js is a peerDependency of this plugin.

npm i video.js @netless/video-js-plugin
# or
yarn add video.js @netless/video-js-plugin

Usage

import "video.js/dist/video-js.css";
import { videoJsPlugin } from "@netless/video-js-plugin";

const plugins = createPlugins({ "video.js": videoJsPlugin });
plugins.setPluginContext("video.js", {
    identity: identity === Identity.creator ? "publisher" : "observer"
});

let sdk = new WhiteWebSdk({ plugins });

let room = await sdk.joinRoom(...);
const pluginId = room.insertPlugin("video.js", {
    originX: -240, originY: -43, width: 480, height: 86,
    attributes: { src: ..., poster: ... },
});

// change the identity (apply to all components created by this plugin)
videoJsPlugin.manager.setContext({ identity: 'publisher' })

Params

interface Context {
    identity:"publisher" | "observer";
}

interface Attributes {
    src: string;
    poster?: string;
    hostTime: number;
    currentTime: number;
    paused: boolean;
    muted: boolean;
    volume: number;
}

License

MIT @ Agora