liusuyi
2024-07-11 b1084891961232e3c697ea9fc52f127cdccffb6b
ard-work/src/main/java/com/ruoyi/media/service/impl/MediaServiceImpl.java
@@ -8,6 +8,7 @@
import com.ruoyi.media.service.IMediaService;
import com.ruoyi.utils.forest.MediaClient;
import com.ruoyi.utils.tools.ArdTool;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
@@ -146,6 +147,8 @@
        if (StringUtils.isNotEmpty(conf.getRunOnDemand())) {
            runOn = conf.getRunOnDemand();
            info.setMode("0");
        } else {
            info.setMode("1");
        }
        //RTSP源地址
        Matcher matcher = Pattern.compile("rtsp://[^\\s\"]+").matcher(runOn);
@@ -184,8 +187,8 @@
    }
    @Override
    public List<StreamInfo> paths() {
        Paths paths = mediaClient.paths();
    public List<StreamInfo> paths(Integer pageNum, Integer pageSize) {
        Paths paths = mediaClient.paths(pageNum - 1, pageSize);
        List<Items> items = paths.getItems();
        List<StreamInfo> pathInfoList = new ArrayList<>();
        for (Items item : items) {
@@ -221,23 +224,17 @@
    @Override
    public RtspSession getRtspSessionById(String sessionId) {
        String list = mediaClient.getRtspsessionById(sessionId);
        RtspSession rtspSession = JSONObject.parseObject(list, RtspSession.class);
        return rtspSession;
        return mediaClient.getRtspsessionById(sessionId);
    }
    @Override
    public WebrtcSession getWebrtcSessionById(String sessionId) {
        String list = mediaClient.getWebrtcsessionById(sessionId);
        WebrtcSession webrtcSession = JSONObject.parseObject(list, WebrtcSession.class);
        return webrtcSession;
        return mediaClient.getWebrtcsessionById(sessionId);
    }
    @Override
    public RtmpSession getRtmpSessionById(String sessionId) {
        String list = mediaClient.getRtmpsessionById(sessionId);
        RtmpSession rtmpSession = JSONObject.parseObject(list, RtmpSession.class);
        return rtmpSession;
        return mediaClient.getRtmpsessionById(sessionId);
    }
    /**
@@ -246,9 +243,9 @@
     * 2023/8/29 9:37:05
     */
    @Override
    public List<StreamInfo> getPushStreamList() {
    public List<StreamInfo> getPushStreamList(Integer pageNum, Integer pageSize) {
        List<StreamInfo> PushStreamInfoList = new ArrayList<>();
        Paths paths = mediaClient.paths();
        Paths paths = mediaClient.paths(pageNum - 1, pageSize);
        List<Items> items = paths.getItems();
        for (Items item : items) {
            StreamInfo info = new StreamInfo();
@@ -321,9 +318,9 @@
     * 2023/8/29 9:37:05
     */
    @Override
    public List<StreamInfo> getPullStreamList() {
    public List<StreamInfo> getPullStreamList(Integer pageNum, Integer pageSize) {
        List<StreamInfo> PullStreamInfoList = new ArrayList<>();
        Paths paths = mediaClient.paths();
        Paths paths = mediaClient.paths(pageNum - 1, pageSize);
        List<Items> items = paths.getItems();
        for (Items item : items) {
            List<Readers> readers = item.getReaders();
@@ -467,7 +464,7 @@
    public List<String> getNameList() {
        List<String> nameList = new ArrayList<>();
        try {
            Paths paths = mediaClient.paths();
            Paths paths = mediaClient.paths(0, 1000);
            List<Items> items = paths.getItems();
            for (Items item : items) {
                nameList.add(item.getName());