cloudrender-web
v1.0.5
Published
webRtc zhyz cloudrender
Downloads
2
Readme
Example Usage
<template>
<div id="player"></div>
</template>
<script>
import cloud from "cloudrender-web/cloudRender.umd";
import { onMounted } from "vue";
export default {
name: "",
setup() {
let appli_id = "xxxx"; // 节点ID
let myhostname = "xxx.xxx.x.xx"; // 节点服务器IP
let paasUrl = "http://xxxx:xxx"; // paas服务对应地址
let username = 'zhangsan';
let password = 'zhangsan_password';
// 初始化云渲染实例
let Dandelion = new cloud(paasUrl,username,password,appli_id);
onMounted(() => {
// // 在页面上显示场景
Dandelion.RtAPI("joinRoom", {
ele: document.querySelector("#player"),
myhostname,
});
/**
* 以下方法非必须调用
*/
// 异步解决方案 事件监听处理器函数, 接收所有从云渲染返回的数据
Dandelion.RtAPI('RegisterCloudResponse', payload => {
switch(payload.type) {
case 'getAllCloud_agents':
// do something
break;
}
case 'get_Allapp':
// do something
break;
}
});
return {};
},
};
</script>