JSPM

  • Created
  • Published
  • Downloads 100
  • Score
    100M100P100Q75191F
  • License MIT

a audio plugin for white-web-sdk which can play audio in whiteboard room and sync to everyone in room

Package Exports

  • @netless/white-audio-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/white-audio-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

white-audio-plugin

https://www.npmjs.com/package/@netless/white-audio-plugin

用法

// 创建 plugins
const plugins = createPlugins({ "audio": audioPlugin });
plugins.setPluginContext("audio", {
    identity: identity === Identity.creator ? "host" : ""
});
// 初始化 sdk 时添加 plugins
let sdk = new WhiteWebSdk({ plugins });

let room = await sdk.joinRoom(...);
// 在房间内添加插件教具
room.insertPlugin("audio", {
    originX: -240, originY: -43, width: 480, height: 86,
    attributes: { src: url, isNavigationDisable: false },
});

参数

interface Context {
    /** 必填,有操作权限者为 "host",观看者为 "guest" */
    identity:"host" | "guest";
}

interface Attributes {
    /** 音频地址 */
    src: string;
    /** 是否隐藏标题栏 */
    isNavigationDisable?: boolean;
}

License

The MIT License.