Skip to content

aaaAcie/ueSDK

Repository files navigation

MXXX说明文档

入口说明

  1. index.ts 是 paas 平台的推流入口

  2. index2.ts 是普通项目的推流入口

  3. index3.ts 是 paas 平台的平行云入口

想要切换入口的时候,在webpack.config.jsentry中找到对应的入口。以及在utils/basic.js引入对应的import

使用说明

把bundle挂在html上,就可以拿到mxxx的所有功能。

连接方式

  myModel.value = new mxxx.initUE({
    url: 'localhost:90'
    domId: 'ppp', // 底座dom,⼤屏有固定的底座位置
    options: {} // 可选剩余参数
    successCallback: (ws: WebSocket) => console.log(ws),  // 连接成功回调⽅法 可以在这里接收当前的websocket连接实例
    errorCallback: (reason) => console.log(reason),  // 连接失败回调⽅法 <-- ue初始化失败(读取关卡数据失败)会进入这里
  })
  // 连接
  myModel.value.connect().then(streamingVideo => {
    console.log(streamingVideo);
  })

普通通信方式:

  // 发消息
  mxxx.emitUIInteraction({
    Category: "消息类型xxx",
    Message: "具体数据"
  });

  // 收消息 
  mxxx.addResponseEventListener("xxx接收的对方的Category的名字写在这里", (data)=> {
    // ue发来的消息会完整地传进来
    console.log(data)
  });

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published