package com.ard.zlm.service.impl;
|
|
import com.ard.common.core.constant.HttpStatus;
|
import com.ard.qs.api.domain.QsDevice;
|
import com.ard.work.api.domian.ArdChannel;
|
import com.ard.zlm.api.domain.StreamInfo;
|
import com.ard.zlm.service.ErrorCallback;
|
import com.ard.zlm.service.IMediaServerService;
|
import com.ard.zlm.service.ISourcePlayService;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
/**
|
* 资源能力接入-实时录像
|
*
|
* @FileName SourcePlayServiceImpl
|
* @Description
|
* @Author fengcheng
|
* @date 2026-04-12
|
**/
|
@Slf4j
|
@Service(DevicePlayServiceImpl.PLAY_SERVICE)
|
public class SourcePlayServiceImpl implements ISourcePlayService {
|
|
@Autowired
|
private IMediaServerService mediaServerService;
|
|
@Override
|
public void play(ArdChannel ardChannel, Boolean record, ErrorCallback<StreamInfo> callback) {
|
try {
|
mediaServerService.play(ardChannel, record, callback);
|
} catch (Exception e) {
|
log.error("[点播失败] {}({})", ardChannel.getName(), ardChannel.getId(), e);
|
callback.run(HttpStatus.ERROR, "播放失败", null);
|
}
|
}
|
}
|