648540858
2022-08-29 d47902bdca2eb772c974803a5bd72e917a294b39
src/main/java/com/genersoft/iot/vmp/service/impl/RedisGbPlayMsgListener.java
@@ -66,8 +66,6 @@
    @Autowired
    private UserSetting userSetting;
    @Autowired
    private RedisUtil redis;
    @Autowired
    private ZLMMediaListManager zlmMediaListManager;
@@ -227,7 +225,7 @@
        WvpRedisMsg response = WvpRedisMsg.getResponseInstance(userSetting.getServerId(), toId,
                WvpRedisMsgCmd.REQUEST_PUSH_STREAM, serial, result);
        JSONObject jsonObject = (JSONObject)JSON.toJSON(response);
        redis.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
        RedisUtil.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
    }
    /**
@@ -246,7 +244,7 @@
                    WvpRedisMsgCmd.GET_SEND_ITEM, serial, result);
            JSONObject jsonObject = (JSONObject)JSON.toJSON(response);
            redis.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
            RedisUtil.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
            return;
        }
        // 确定流是否在线
@@ -269,11 +267,11 @@
                        userSetting.getServerId(), toId, WvpRedisMsgCmd.GET_SEND_ITEM, serial, result
                );
                JSONObject jsonObject = (JSONObject)JSON.toJSON(response);
                redis.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
                RedisUtil.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
            }, userSetting.getPlatformPlayTimeout());
            // 添加订阅
            HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed(content.getApp(), content.getStream(), true, "rtmp", mediaServerItem.getId());
            HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed(content.getApp(), content.getStream(), true, "rtsp", mediaServerItem.getId());
            subscribe.addSubscribe(hookSubscribe, (MediaServerItem mediaServerItemInUse, JSONObject json)->{
                        dynamicTask.stop(taskKey);
@@ -308,7 +306,7 @@
                userSetting.getServerId(), toId, WvpRedisMsgCmd.GET_SEND_ITEM, serial, result
        );
        JSONObject jsonObject = (JSONObject)JSON.toJSON(response);
        redis.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
        RedisUtil.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
    }
    /**
@@ -345,7 +343,7 @@
            wvpResult.setMsg("timeout");
            errorCallback.handler(wvpResult);
        }, userSetting.getPlatformPlayTimeout());
        redis.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
        RedisUtil.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
    }
    /**
@@ -370,6 +368,6 @@
            callbacksForStartSendRtpStream.remove(key);
            callbacksForError.remove(key);
        });
        redis.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
        RedisUtil.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
    }
}