Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c568df commit 899242bCopy full SHA for 899242b
ezuikit-talk.js
@@ -169,7 +169,25 @@
169
// })
170
// }
171
EZUITalk.prototype.startTalk = function(){
172
- window.startTalk();
+ var _this = this;
173
+ var apiSuccess = function(data) {
174
+ if (data.code == 200) {
175
+ var apiResult = data.data;
176
+ if (apiResult) {
177
+ // 临时将https转换为websocket
178
+ _this.opt.stream = apiResult.stream;
179
+ window.startTalk();
180
+ }
181
182
183
+ var apiError = function() {
184
+ layer.msg("获取对讲token失败")
185
186
+ request(_this.opt.apiDomain, 'POST', {
187
+ accessToken: _this.opt.accessToken,
188
+ deviceSerial: _this.opt.deviceSerial,
189
+ channelNo: _this.opt.channelNo
190
+ }, '', apiSuccess, apiError);
191
}
192
EZUITalk.prototype.stopTalk = function(){
193
window.stopTalk();
0 commit comments