JSPM

@netless/window-manager

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1747
  • Score
    100M100P100Q115913F
  • License ISC

Package Exports

  • @netless/window-manager

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/window-manager) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

WindowManager

注意事项

多窗口模式必须开启白板的 useMultiViews 选项

会造成原本以下 room 上的一些方法和 state 失效

方法

  • room.scalePptToFit()
  • room.moveCamera()
  • room.moveCameraToContain()
  • room.setCameraBound()

关于 camera 的所有操作, 请使用

manager.mainView.moveCamera()
manager.mainView.moveCameraToContain()
manager.mainView.setCameraBound()

state

  • room.state.cameraState

想要监听主白板 camera 的变化, 请使用如下方式代替

manager.mainView.callbacks.on("onCameraUpdated", (camera) => {
    console.log(camera)
})

监听主白板 size 变化

manager.mainView.callbacks.on("onSizeUpdated", (size) => {
    console.log(size)
})

并且暂不支持原本的主播模式

接入

import { WhiteWebSdk } from "white-web-sdk";
import { WindowManager } from "@netless/window-manager";

WindowManager.register(APP); // APP 为应用实例

const sdk = new WhiteWebSdk({
    appIdentifier: "appIdentifier"
});

sdk.joinRoom({
    uuid: "room uuid",
    roomToken: "room token",
    invisiblePlugins: [WindowManager],
    useMultiViews: true, // 多窗口必须用开启 useMultiViews
}).then(async room => {
    const manager = await WindowManager.mount(
        room, // 房间实例
        continaer, // 挂载 dom 容器, 等同于 room.bindHtmlElement(continaer)
        collector, // 可选, 用于多窗口最小化挂载的 dom
        { debug: true } // 可选, 调试用
    );
});

添加 app 到白板上

manager.addApp({
    kind: App.kind,
    options: {
        scenePath: "/xxxx",
        title: "app1"
    },
    attributes: {
        // 插件需要的属性值
    }
});

开发流程

yarn build:lib

cd test

yarn dev