Skip to content

Commit 06dd848

Browse files
committed
demo: update
1 parent 686798f commit 06dd848

File tree

4 files changed

+36
-10
lines changed

4 files changed

+36
-10
lines changed

demos/base-demo/ezuikit.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/base-demo/index.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
<meta charset="UTF-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
77
<title>Document</title>
8+
<style>
9+
#video-container {
10+
width: 600px;
11+
height: 400px;
12+
background-color: #000;
13+
}
14+
</style>
815
<script src="./ezuikit.js"></script>
916
</head>
1017

@@ -46,8 +53,8 @@ <h2>视频模式使用示例:</h2>
4653
player = new EZUIKit.EZUIKitPlayer({
4754
id: "video-container", // 视频容器ID
4855
accessToken:
49-
"at.5eust80k24rnxeao5ubhg3we8xg3fe2y-2obk7hy2h9-0c9z5t2-6gjyxouc",
50-
url: "ezopen://open.ys7.com/L16120197/1.hd.live",
56+
"at.1gskp9sk9b8pol288qw4f0ladj6ow00a-2obk8zrvgd-0icd73x",
57+
url: "ezopen://open.ys7.com/BA7248908/1.hd.live",
5158
template: "pcLive", // simple: 极简版; pcLive: 预览; pcRec: 回放; security: 安防版; voice: 语音版;
5259
plugin: ["talk"], // 加载插件,talk-对讲
5360
width: 600,

demos/base-demo/mobileLive.html

+10-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ <h2>视频模式使用示例:</h2>
3232
<button onClick="ezopenStartTalk()">开始对讲</button>
3333
<button onClick="ezopenStopTalk()">结束对讲</button>
3434
<button onClick="fullScreen()">全屏</button>
35+
<button onClick="destroy()">destroy</button>
3536
</div>
3637
<p style="font-style: italic;">播放多个视频,可初始化多个实例,参考:/demos/base-demo/multi-demo</p>
3738
</div>
@@ -46,8 +47,8 @@ <h2>视频模式使用示例:</h2>
4647
player = new EZUIKit.EZUIKitPlayer({
4748
id: 'video-container', // 视频容器ID
4849
accessToken:
49-
"at.5eust80k24rnxeao5ubhg3we8xg3fe2y-2obk7hy2h9-0c9z5t2-6gjyxouc",
50-
url: "ezopen://open.ys7.com/L16120197/1.hd.live",
50+
"at.1gskp9sk9b8pol288qw4f0ladj6ow00a-2obk8zrvgd-0icd73x-",
51+
url: "ezopen://open.ys7.com/BA7248908/1.hd.live",
5152
template: 'mobileLive', // simple: 极简版; pcLive: 预览; pcRec: 回放; security: 安防版; voice: 语音版;
5253
plugin: ['talk'], // 加载插件,talk-对讲
5354
width: width,
@@ -122,6 +123,13 @@ <h2>视频模式使用示例:</h2>
122123
function ezopenStopTalk() {
123124
player.stopTalk();
124125
}
126+
127+
function destroy() {
128+
if (player) {
129+
player.destroy();
130+
}
131+
player = null;
132+
}
125133
</script>
126134
</body>
127135

demos/base-demo/mobileRec.html

+13-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
<button onClick="ezopenStartTalk()">开始对讲</button>
3131
<button onClick="ezopenStopTalk()">结束对讲</button>
3232
<button onClick="fullScreen()">全屏</button>
33+
<button onClick="destroy()">destroy</button>
34+
3335
</div>
3436
<p style="font-style: italic;">播放多个视频,可初始化多个实例,参考:/demos/base-demo/multi-demo</p>
3537
</div>
@@ -47,8 +49,8 @@
4749
player = new EZUIKit.EZUIKitPlayer({
4850
id: 'video-container', // 视频容器ID
4951
accessToken:
50-
"at.5eust80k24rnxeao5ubhg3we8xg3fe2y-2obk7hy2h9-0c9z5t2-6gjyxouc",
51-
url: "ezopen://open.ys7.com/L16120197/1.rec",
52+
"at.1gskp9sk9b8pol288qw4f0ladj6ow00a-2obk8zrvgd-0icd73x-",
53+
url: "ezopen://open.ys7.com/BA7248908/1.rec",
5254
template: 'mobileRec', // simple: 极简版; pcLive: 预览; pcRec: 回放; security: 安防版; voice: 语音版;
5355
width: width,
5456
height: width * 9 / 16,
@@ -116,12 +118,21 @@
116118
console.log("promise 获取 数据", data)
117119
})
118120
}
121+
119122
function ezopenStartTalk() {
120123
player.startTalk();
121124
}
125+
122126
function ezopenStopTalk() {
123127
player.stopTalk();
124128
}
129+
130+
function destroy() {
131+
if (player) {
132+
player.destroy();
133+
}
134+
player = null;
135+
}
125136
</script>
126137
</body>
127138

0 commit comments

Comments
 (0)