Commit f14649cf19e2f666c9ffa138ba901a1a26fb3af7

Authored by chenjunyu_1481036421
1 parent d564ee08

feat:萤石增加 清晰度选项

... ... @@ -47,7 +47,7 @@ public class TkVideoDTO extends TenantDTO {
47 47 @ApiModelProperty(value = "平台ID")
48 48 private String videoPlatformId;
49 49
50   - @ApiModelProperty(value = "码流:0主码流 1子码流 2第三码流")
  50 + @ApiModelProperty(value = "码流:0主码流 1子码流(萤石高清) 2第三码流(萤石流畅)")
51 51 private Integer streamType;
52 52
53 53 @ApiModelProperty(value = "播放协议:0 http 1 https")
... ...
... ... @@ -21,15 +21,15 @@ public class EzvizUtils {
21 21 private static String accessToken;
22 22 private static Long expireTime;
23 23
24   - public static String getCameraPreviewURL(String appKey, String appSecret, String sn) throws IOException {
  24 + public static String getCameraPreviewURL(String appKey, String appSecret, String sn,Integer streamType) throws IOException {
25 25 //查询缓存中是否已有该设备的直播url
26   - String videoUrl = VideoNumbersUtils.getUrl(appKey+sn);
  26 + String videoUrl = VideoNumbersUtils.getUrl(appKey+sn+streamType);
27 27 if(!StringUtils.isEmpty(videoUrl)){
28 28 return videoUrl;
29 29 }
30 30 getAccessTokenByUrl(appKey,appSecret);
31 31 String cameraPreviewURL = url+"v2/live/address/get?accessToken="+accessToken+
32   - "&deviceSerial="+sn+"&protocol=4&quality=1";
  32 + "&deviceSerial="+sn+"&protocol=4&quality="+streamType;
33 33 //调用接口
34 34 String result = HttpClientUtils.sendPOST(cameraPreviewURL,"");
35 35 //返回url地址
... ...
... ... @@ -107,7 +107,7 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid
107 107 return HikVisionArtemis(videoDTO,protocolType);
108 108 }
109 109 if (videoPlatformDTO.getType()==1){
110   - return EzvizUtils.getCameraPreviewURL(videoPlatformDTO.getAppKey(),videoPlatformDTO.getAppSecret(),videoDTO.getSn());
  110 + return EzvizUtils.getCameraPreviewURL(videoPlatformDTO.getAppKey(),videoPlatformDTO.getAppSecret(),videoDTO.getSn(),videoDTO.getStreamType());
111 111 }
112 112 return null;
113 113 }
... ...