Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 28d20ed

Browse files
committed
[CHG]更新版本到v0.2.3
1 parent 1a80b3f commit 28d20ed

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

demos/base-demo/ezuikit.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1503,8 +1503,34 @@
15031503
EZUIKitPlayer.prototype.startTalk = function () {
15041504
console.log("执行开始对讲");
15051505
console.log(this.opt);
1506+
var _this = this;
15061507
EZUIKit.opt = this.opt;
1507-
window.startTalk();
1508+
var apiSuccess = function(data) {
1509+
if (data.code == 200) {
1510+
var apiResult = data.data;
1511+
if (apiResult) {
1512+
// 临时将https转换为websocket
1513+
var rtcTrunk = apiResult.rtcUrl;
1514+
if (rtcTrunk.indexOf("ws") === -1) {
1515+
rtcTrunk = rtcTrunk.replace("https", "wss").replace("rtcgw", "rtcgw-ws");
1516+
}
1517+
_this.opt.rtcUrl = rtcTrunk;
1518+
_this.opt.ttsUrl = "tts://" + apiResult.ttsUrl;
1519+
var talk = "talk://" + _this.opt.deviceSerial + ":0:" + _this.opt.channelNo + ":cas.ys7.com:6500";
1520+
_this.opt.talkLink = _this.opt.ttsUrl + "/" + talk;
1521+
_this.opt.stream = apiResult.stream;
1522+
window.startTalk();
1523+
}
1524+
}
1525+
}
1526+
var apiError = function() {
1527+
layer.msg("获取对讲token失败")
1528+
}
1529+
request(_this.opt.apiDomain, 'POST', {
1530+
accessToken: _this.opt.accessToken,
1531+
deviceSerial: _this.opt.deviceSerial,
1532+
channelNo: _this.opt.channelNo
1533+
}, '', apiSuccess, apiError);
15081534
};
15091535

15101536
EZUIKitPlayer.prototype.stopTalk = function () {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ezuikit-js",
3-
"version": "0.2.0",
3+
"version": "0.2.3",
44
"description": "ezuikit javascript for npm",
55
"main": "ezuikit.js",
66
"scripts": {

0 commit comments

Comments
 (0)