|
@@ -118,6 +118,7 @@ public class CameraServiceImpl implements CameraService {
|
|
|
jsonBody.put("cameraIndexCode", cameraIndexCode);
|
|
|
jsonBody.put("streamType", 0);
|
|
|
jsonBody.put("protocol", "httpflv");
|
|
|
+ //jsonBody.put("protocol", "rtsp");
|
|
|
jsonBody.put("transmode", 1);
|
|
|
jsonBody.put("expand", "streamform=ps");
|
|
|
|
|
@@ -269,6 +270,32 @@ public class CameraServiceImpl implements CameraService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public AjaxResult appVideo(String cameraIndexCode) {
|
|
|
+ if(StringUtils.isEmpty(cameraIndexCode)){
|
|
|
+ throw new ServiceException("参数错误");
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * STEP3:设置接口的URI地址
|
|
|
+ */
|
|
|
+ String url = "/api/video/v2/cameras/previewURLs";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * STEP5:组装请求参数
|
|
|
+ */
|
|
|
+ JSONObject jsonBody = new JSONObject();
|
|
|
+ jsonBody.put("cameraIndexCode", cameraIndexCode);
|
|
|
+ jsonBody.put("streamType", 0);
|
|
|
+ //jsonBody.put("protocol", "httpflv");
|
|
|
+ jsonBody.put("protocol", "rtsp");
|
|
|
+ jsonBody.put("transmode", 1);
|
|
|
+ jsonBody.put("expand", "streamform=ps");
|
|
|
+
|
|
|
+ String result = GetCameraPreviewURL.GetCameraPreviewURL(url,jsonBody.toString());
|
|
|
+ JSONObject jsonObject = JSON.parseObject(result);
|
|
|
+ return AjaxResult.success(jsonObject);
|
|
|
+ }
|
|
|
+
|
|
|
/*public static void main(String[] args) {
|
|
|
|
|
|
// 获取当前时间
|