|
@@ -268,14 +268,14 @@ class HaiKangController extends BaseController
|
|
|
$parent_id = Input::get('parent_id');
|
|
|
$protocol = Input::get('protocol', 'hls');
|
|
|
$streamType = Input::get('streamType', 1);
|
|
|
- $url = $this->artemis . '/api/video/v1/cameras/previewURLs';
|
|
|
+ $url = $this->artemis . '/api/video/v2/cameras/previewURLs';
|
|
|
// $cameras_info = json_decode($this->getCamerasInfo(Input::all()), true);
|
|
|
//请求参数
|
|
|
$params = [];
|
|
|
// $params['regionIndexCode'] = $request->input('regionIndexCode');
|
|
|
$params['cameraIndexCode'] = Input::get('cameraIndexCode');
|
|
|
$params['streamType'] = $streamType; //0主码流 1子码流 2第三码流
|
|
|
- $params['protocol'] = 'ws';
|
|
|
+ $params['protocol'] = 'wss';
|
|
|
$params['transmode'] = 1; //0:UDP 1:TCP
|
|
|
$params['expand'] = 'streamform=rtp';
|
|
|
|
|
@@ -292,6 +292,36 @@ class HaiKangController extends BaseController
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
+ //洗选执法记录仪对讲
|
|
|
+ public function getHikTalkUrl(){
|
|
|
+ if (!Input::has('cameraIndexCode')) {
|
|
|
+ return $this->error(1, '缺少必要参数');
|
|
|
+ }
|
|
|
+ $parent_id = Input::get('parent_id');
|
|
|
+ $protocol = Input::get('protocol', 'hls');
|
|
|
+ $streamType = Input::get('streamType', 1);
|
|
|
+ $url = $this->artemis . '/api/video/v1/cameras/talkURLs';
|
|
|
+// $cameras_info = json_decode($this->getCamerasInfo(Input::all()), true);
|
|
|
+ //请求参数
|
|
|
+ $params = [];
|
|
|
+// $params['regionIndexCode'] = $request->input('regionIndexCode');
|
|
|
+ $params['cameraIndexCode'] = Input::get('cameraIndexCode');
|
|
|
+ $params['transmode'] = 1; //0:UDP 1:TCP
|
|
|
+ $params['expand'] = 'streamform=ps';
|
|
|
+
|
|
|
+ $this->sign = $this->get_sign($url);
|
|
|
+
|
|
|
+ $result = $this->curlPost($this->pre_url . $url, json_encode($params));
|
|
|
+ $result = json_decode($result, true);
|
|
|
+ if (isset($result['code']) && $result['code'] == 0 && $parent_id != 353) { // 将内网地址替换为外网地址,除了羊二
|
|
|
+ $video_url = $result['data']['url'];
|
|
|
+ preg_match('/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/i', $video_url, $res); // 提取内网ip
|
|
|
+ preg_match('/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/i', $this->pre_url, $res_n); // 提取外网ip
|
|
|
+ $result['data']['url'] = str_replace($res, $res_n, $video_url);
|
|
|
+ }
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取摄像头码流url
|
|
|
* @return array|mixed
|