feat: 点播开始后的截图任务,判断启用https后使用https_fmp4流地址
Signed-off-by: duzeng <duzengrass@163.com>pull/640/head
parent
b19a885f1d
commit
a463b676e2
|
@ -27,3 +27,4 @@ hs_err_pid*
|
||||||
/target/
|
/target/
|
||||||
|
|
||||||
/src/main/resources/static/
|
/src/main/resources/static/
|
||||||
|
certificates
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.context.request.async.DeferredResult;
|
import org.springframework.web.context.request.async.DeferredResult;
|
||||||
|
@ -112,7 +113,8 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ThreadPoolTaskExecutor taskExecutor;
|
private ThreadPoolTaskExecutor taskExecutor;
|
||||||
|
|
||||||
|
@Value("${server.ssl.enabled}")
|
||||||
|
private boolean sslEnabled;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PlayResult play(MediaServerItem mediaServerItem, String deviceId, String channelId,
|
public PlayResult play(MediaServerItem mediaServerItem, String deviceId, String channelId,
|
||||||
|
@ -147,7 +149,8 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
if (Objects.requireNonNull(wvpResult).getCode() == 0) {
|
if (Objects.requireNonNull(wvpResult).getCode() == 0) {
|
||||||
StreamInfo streamInfoForSuccess = (StreamInfo) wvpResult.getData();
|
StreamInfo streamInfoForSuccess = (StreamInfo) wvpResult.getData();
|
||||||
MediaServerItem mediaInfo = mediaServerService.getOne(streamInfoForSuccess.getMediaServerId());
|
MediaServerItem mediaInfo = mediaServerService.getOne(streamInfoForSuccess.getMediaServerId());
|
||||||
String streamUrl = streamInfoForSuccess.getFmp4();
|
String streamUrl = sslEnabled ? streamInfoForSuccess.getHttps_fmp4() : streamInfoForSuccess.getFmp4();
|
||||||
|
|
||||||
// 请求截图
|
// 请求截图
|
||||||
logger.info("[请求截图]: " + fileName);
|
logger.info("[请求截图]: " + fileName);
|
||||||
zlmresTfulUtils.getSnap(mediaInfo, streamUrl, 15, 1, path, fileName);
|
zlmresTfulUtils.getSnap(mediaInfo, streamUrl, 15, 1, path, fileName);
|
||||||
|
@ -247,7 +250,6 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void play(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId,
|
public void play(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId,
|
||||||
ZlmHttpHookSubscribe.Event hookEvent, SipSubscribe.Event errorEvent,
|
ZlmHttpHookSubscribe.Event hookEvent, SipSubscribe.Event errorEvent,
|
||||||
|
|
Loading…
Reference in New Issue