Commit 94a2241834c078120f4fe6976191574e71cbb8b2

Authored by xp.Huang
2 parents 8e4c6575 45231c29

Merge branch '2023-12-28' into 'master_dev'

feat:萤石获取链接增加视频格式选项

See merge request yunteng/thingskit!302
@@ -47,10 +47,10 @@ public class TkVideoDTO extends TenantDTO { @@ -47,10 +47,10 @@ public class TkVideoDTO extends TenantDTO {
47 @ApiModelProperty(value = "平台ID") 47 @ApiModelProperty(value = "平台ID")
48 private String videoPlatformId; 48 private String videoPlatformId;
49 49
50 - @ApiModelProperty(value = "码流:0主码流 1子码流(萤石高清) 2第三码流(萤石流畅)") 50 + @ApiModelProperty(value = "码流:0主码流 1子码流 (或萤石高清) 2第三码流(或萤石流畅)")
51 private Integer streamType; 51 private Integer streamType;
52 52
53 - @ApiModelProperty(value = "播放协议:0 http 1 https") 53 + @ApiModelProperty(value = "海康ISC:0 http 1 https(用于判断HLS/HLSS) 萤石云:2(萤石云hls) 4(萤石云flv) ")
54 private Integer playProtocol; 54 private Integer playProtocol;
55 55
56 @ApiModelProperty(value = "流媒体平台基础信息") 56 @ApiModelProperty(value = "流媒体平台基础信息")
@@ -22,7 +22,7 @@ public class EzvizUtils { @@ -22,7 +22,7 @@ public class EzvizUtils {
22 private static String accessToken; 22 private static String accessToken;
23 private static Long expireTime; 23 private static Long expireTime;
24 24
25 - public static String getCameraPreviewURL(String appKey, String appSecret, String sn,Integer streamType) throws IOException { 25 + public static String getCameraPreviewURL(String appKey, String appSecret, String sn,Integer streamType,Integer playProtocol) throws IOException {
26 String key = appKey+sn; 26 String key = appKey+sn;
27 //查询缓存中是否已有该设备的直播url 27 //查询缓存中是否已有该设备的直播url
28 String videoUrl = VideoUrlUtils.getUrl(key); 28 String videoUrl = VideoUrlUtils.getUrl(key);
@@ -31,7 +31,7 @@ public class EzvizUtils { @@ -31,7 +31,7 @@ public class EzvizUtils {
31 } 31 }
32 getAccessTokenByUrl(appKey,appSecret); 32 getAccessTokenByUrl(appKey,appSecret);
33 String cameraPreviewURL = url+"v2/live/address/get?accessToken="+accessToken+ 33 String cameraPreviewURL = url+"v2/live/address/get?accessToken="+accessToken+
34 - "&deviceSerial="+sn+"&protocol=4&quality="+streamType; 34 + "&deviceSerial="+sn+"&protocol="+playProtocol+"&quality="+streamType;
35 //调用接口 35 //调用接口
36 String result = HttpClientUtils.sendPOST(cameraPreviewURL,""); 36 String result = HttpClientUtils.sendPOST(cameraPreviewURL,"");
37 //返回url地址 37 //返回url地址
@@ -99,7 +99,7 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid @@ -99,7 +99,7 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid
99 return HikVisionArtemis(videoDTO,protocolType); 99 return HikVisionArtemis(videoDTO,protocolType);
100 } 100 }
101 if (videoPlatformDTO.getType()==1){ 101 if (videoPlatformDTO.getType()==1){
102 - return EzvizUtils.getCameraPreviewURL(videoPlatformDTO.getAppKey(),videoPlatformDTO.getAppSecret(),videoDTO.getSn(),videoDTO.getStreamType()); 102 + return EzvizUtils.getCameraPreviewURL(videoPlatformDTO.getAppKey(),videoPlatformDTO.getAppSecret(),videoDTO.getSn(),videoDTO.getStreamType(),videoDTO.getPlayProtocol());
103 } 103 }
104 return null; 104 return null;
105 } 105 }