|
@@ -22,6 +22,7 @@ import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
|
import com.genersoft.iot.vmp.service.*;
|
|
import com.genersoft.iot.vmp.service.*;
|
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
|
|
|
+import com.genersoft.iot.vmp.storager.dao.dto.AdminAccount;
|
|
import com.genersoft.iot.vmp.utils.AuthorUtil;
|
|
import com.genersoft.iot.vmp.utils.AuthorUtil;
|
|
import com.genersoft.iot.vmp.utils.DeviceHelper;
|
|
import com.genersoft.iot.vmp.utils.DeviceHelper;
|
|
import com.genersoft.iot.vmp.utils.Md5Utils;
|
|
import com.genersoft.iot.vmp.utils.Md5Utils;
|
|
@@ -321,8 +322,16 @@ public class PlayController {
|
|
String type = "push";
|
|
String type = "push";
|
|
|
|
|
|
// LoginUser userInfo = SecurityUtils.getUserInfo();
|
|
// LoginUser userInfo = SecurityUtils.getUserInfo();
|
|
- // todo 生成设备推流鉴权密钥, 无论是什么用户登录都可以正常使用
|
|
|
|
- String sign = Md5Utils.hash(adminService.getUserById("1").getPushKey()); //获取推流鉴权密钥
|
|
|
|
|
|
+ String adminId = AuthorUtil.getAdminId();
|
|
|
|
+ AdminAccount adminAccount;
|
|
|
|
+ if (adminId != null) {
|
|
|
|
+ adminAccount = adminService.getUserById(adminId);
|
|
|
|
+ } else {
|
|
|
|
+ logger.info("[语音广播] 获取主管理员账户");
|
|
|
|
+ adminAccount = adminService.getPrimaryAdmin();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String sign = Md5Utils.hash(adminAccount.getPushKey()); //获取推流鉴权密钥
|
|
String webRtcPushUrl = String.format("https://%s:%s/index/api/webrtc?app=%s&stream=%s&type=%s&sign=%s", mediaServerItem.getIp(), mediaServerItem.getHttpSSlPort(), app, stream, type, sign);
|
|
String webRtcPushUrl = String.format("https://%s:%s/index/api/webrtc?app=%s&stream=%s&type=%s&sign=%s", mediaServerItem.getIp(), mediaServerItem.getHttpSSlPort(), app, stream, type, sign);
|
|
|
|
|
|
//首先判断设备是否正在对讲
|
|
//首先判断设备是否正在对讲
|