zhyz-cloudrender-v5 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -0
- package/adapter.js +3364 -0
- package/cloudRender.es.js +24523 -0
- package/cloudRender.js +24529 -0
- package/cloudRender.umd.js +24531 -0
- package/p2p.js +1426 -0
- package/package.json +11 -0
- package/webRtcPlayer.js +575 -0
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
## Example Usage
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
<template>
|
|
5
|
+
<div id="player">
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
<script>
|
|
9
|
+
import cloud from "zhyz-cloudrender-v5/cloudRender.umd";
|
|
10
|
+
import { onMounted, onBeforeUnmount } from "vue";
|
|
11
|
+
export default {
|
|
12
|
+
setup() {
|
|
13
|
+
let appliId = "xxxx"; // 云渲染节点中的某个容器的ID
|
|
14
|
+
let myhostname = "xxx.xxx.x.xx"; // 云渲染节点的流媒体地址
|
|
15
|
+
let paasUrl = "http://xxxx:xxx"; // paas服务对应地址
|
|
16
|
+
let protooPort = "xxxx"; // 云渲染节点的流媒体端口
|
|
17
|
+
let username = "zhangsan";
|
|
18
|
+
let password = "zhangsan_password";
|
|
19
|
+
let isReturnNativeResponse = true; //是否返回原生响应头
|
|
20
|
+
let isP2p = false;
|
|
21
|
+
// 初始化云渲染实例
|
|
22
|
+
let Dandelion = new cloud(paasUrl, username, password, appliId, isP2p, isReturnNativeResponse);
|
|
23
|
+
onMounted(() => {
|
|
24
|
+
// 在页面上显示场景
|
|
25
|
+
Dandelion.RtAPI("joinRoom", {
|
|
26
|
+
ele: document.querySelector("#player"), //指定的挂载三维场景的页面元素
|
|
27
|
+
myhostname,
|
|
28
|
+
appliId,
|
|
29
|
+
protooPort,
|
|
30
|
+
});
|
|
31
|
+
onBeforeUnmount(() => {
|
|
32
|
+
Dandelion.RtAPI("destroyedP2p");
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* api调用示例
|
|
37
|
+
*/
|
|
38
|
+
Dandelion.RtAPI(
|
|
39
|
+
"getPoiList",
|
|
40
|
+
{
|
|
41
|
+
view: false, //true获取视图内,false获取视图外
|
|
42
|
+
},
|
|
43
|
+
(res) => {
|
|
44
|
+
// res 为接口返回数据
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
return {};
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
```
|