liusuyi
2026-06-01 a2e7e8ff9cfaa69b001d483710bddbda50d55c91
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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);
        }
    }
}