优化前端云端录像的播放

This commit is contained in:
648540858
2023-12-06 16:10:32 +08:00
parent 7e136c9ac7
commit 92e5ed2e30
7 changed files with 80 additions and 20 deletions

View File

@@ -0,0 +1,22 @@
package com.genersoft.iot.vmp.utils;
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
import com.genersoft.iot.vmp.service.bean.DownloadFileInfo;
public class CloudRecordUtils {
public static DownloadFileInfo getDownloadFilePath(MediaServerItem mediaServerItem, String filePath) {
DownloadFileInfo downloadFileInfo = new DownloadFileInfo();
String pathTemplate = "%s://%s:%s/index/api/downloadFile?file_path=" + filePath;
downloadFileInfo.setHttpPath(String.format(pathTemplate, "http", mediaServerItem.getStreamIp(),
mediaServerItem.getHttpPort()));
if (mediaServerItem.getHttpSSlPort() > 0) {
downloadFileInfo.setHttpsPath(String.format(pathTemplate, "https", mediaServerItem.getStreamIp(),
mediaServerItem.getHttpSSlPort()));
}
return downloadFileInfo;
}
}