-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy paththemeData.html
232 lines (228 loc) · 6.77 KB
/
themeData.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>Document</title>
<script src="./ezuikit.js"></script>
</head>
<body>
<div className="demo">
<h2>视频模式使用示例:</h2>
<div id="video-container" style="width:600px;">
</div>
<div>
<button onClick="play()">play</button>
<button onClick="stop()">stop</button>
<button onClick="getOSDTime()">getOSDTime</button>
<button onClick="capturePicture()">capturePicture</button>
<button onClick="openSound()">openSound</button>
<button onClick="closeSound()">closeSound</button>
<button onClick="startSave()">startSave</button>
<button onClick="stopSave()">stopSave</button>
<button onClick="ezopenStartTalk()">开始对讲</button>
<button onClick="ezopenStopTalk()">结束对讲</button>
<button onClick="fullScreen()">全屏</button>
</div>
<p style="font-style: italic;">播放多个视频,可初始化多个实例,参考:/demos/base-demo/multi-demo</p>
</div>
<script>
var themeData = {
"header": {
"color": "#1890ff",
"activeColor": "#FFFFFF",
"backgroundColor": "#000000",
"btnList": [
{
"iconId": "deviceID",
"part": "left",
"defaultActive": 0,
"memo": "顶部设备序列号",
"isrender": 1
},
{
"iconId": "deviceName",
"part": "left",
"defaultActive": 0,
"memo": "顶部设备名称",
"isrender": 1
},
{
"iconId": "cloudRec",
"part": "right",
"defaultActive": 0,
"memo": "云存储",
"isrender": 0
},
{
"iconId": "rec",
"part": "right",
"defaultActive": 0,
"memo": "SD卡回放",
"isrender": 0
}
]
},
"footer": {
"color": "#FFFFFF",
"activeColor": "#1890FF",
"backgroundColor": "#00000021",
"btnList": [
{
"iconId": "play",
"part": "left",
"defaultActive": 1,
"memo": "播放",
"isrender": 1
},
{
"iconId": "capturePicture",
"part": "left",
"defaultActive": 0,
"memo": "截屏按钮",
"isrender": 1
},
{
"iconId": "sound",
"part": "left",
"defaultActive": 0,
"memo": "声音按钮",
"isrender": 1
},
{
"iconId": "pantile",
"part": "left",
"defaultActive": 0,
"memo": "云台控制按钮",
"isrender": 1
},
{
"iconId": "recordvideo",
"part": "left",
"defaultActive": 0,
"memo": "录制按钮",
"isrender": 1
},
{
"iconId": "talk",
"part": "left",
"defaultActive": 0,
"memo": "对讲按钮",
"isrender": 1
},
{
"iconId": "zoom",
"part": "left",
"defaultActive": 0,
"memo": "电子放大",
"isrender": 1
},
{
"iconId": "hd",
"part": "right",
"defaultActive": 0,
"memo": "清晰度切换按钮",
"isrender": 1
},
{
"iconId": "webExpend",
"part": "right",
"defaultActive": 0,
"memo": "网页全屏按钮",
"isrender": 1
},
{
"iconId": "expend",
"part": "right",
"defaultActive": 0,
"memo": "全局全屏按钮",
"isrender": 1
}
]
}
};
var player;
fetch('https://open.ys7.com/jssdk/ezopen/demo/token')
.then(response => response.json())
.then(res => {
var accessToken = res.data.accessToken;
player = new EZUIKit.EZUIKitPlayer({
id: 'video-container', // 视频容器ID
accessToken: accessToken,
url: 'ezopen://open.ys7.com/G39444019/1.live',
//template: 'simple', // simple: 极简版; pcLive: 预览; pcRec: 回放; security: 安防版; voice: 语音版;
themeData: themeData,
plugin: ['talk'], // 加载插件,talk-对讲
width: 600,
height: 400,
env: {
// https://open.ys7.com/help/1772?h=domain
// domain默认是 https://open.ys7.com, 如果是私有化部署或海外的环境,请配置对应的domain
// The default domain is https://open.ys7.com If it is a private deployment or overseas (outside of China) environment, please configure the corresponding domain
domain: "https://open.ys7.com"
}
});
});
function fullScreen() {
var playPromise = player.fullScreen();
playPromise.then((data) => {
console.log("promise 获取 数据", data)
})
}
function play() {
var playPromise = player.play();
playPromise.then((data) => {
console.log("promise 获取 数据", data)
})
}
function stop() {
var stopPromise = player.stop();
stopPromise.then((data) => {
console.log("promise 获取 数据", data)
})
}
function getOSDTime() {
var getOSDTimePromise = player.getOSDTime();
getOSDTimePromise.then((data) => {
console.log("promise 获取 数据", data)
})
}
function capturePicture() {
var capturePicturePromise = player.capturePicture();
capturePicturePromise.then((data) => {
console.log("promise 获取 数据", data)
})
}
function openSound() {
var openSoundPromise = player.openSound();
openSoundPromise.then((data) => {
console.log("promise 获取 数据", data)
})
}
function closeSound() {
var closeSoundPromise = player.closeSound();
closeSoundPromise.then((data) => {
console.log("promise 获取 数据", data)
})
}
function startSave() {
var startSavePromise = player.startSave();
startSavePromise.then((data) => {
console.log("promise 获取 数据", data)
})
}
function stopSave() {
var stopSavePromise = player.stopSave();
stopSavePromise.then((data) => {
console.log("promise 获取 数据", data)
})
}
function ezopenStartTalk() {
player.startTalk();
}
function ezopenStopTalk() {
player.stopTalk();
}
</script>
</body>
</html>