hzk-test
v2.0.3
Published
cloudrender zhyz
Downloads
22
Readme
Example Usage
<template>
<div id="player">
</div>
</template>
<script>
import cloud from "zhyz-cloudrender-v4/cloudRender.umd";
import { onMounted, onBeforeUnmount } from "vue";
export default {
setup() {
let appliId = "xxxx"; // 云渲染节点中的某个容器的ID
let myhostname = "xxx.xxx.x.xx"; // 云渲染节点的流媒体地址
let paasUrl = "http://xxxx:xxx"; // paas服务对应地址
let protooPort = "xxxx"; // 云渲染节点的流媒体端口
let username = "zhangsan";
let password = "zhangsan_password";
let isHttps = false;
let isP2p = false;
// 初始化云渲染实例
let Dandelion = new cloud(paasUrl, username, password, isHttps, appliId, isP2p);
onMounted(() => {
// 在页面上显示场景
Dandelion.RtAPI("joinRoom", {
ele: document.querySelector("#player"), //指定的挂载三维场景的页面元素
myhostname,
appliId,
protooPort,
});
onBeforeUnmount(() => {
Dandelion.RtAPI("destroyedP2p");
});
/**
* api调用示例
*/
Dandelion.RtAPI(
"getPoiList",
{
view: false, //true获取视图内,false获取视图外
},
(res) => {
// res 为接口返回数据
}
);
return {};
});
},
};
</script>