From 835138db9f663a276f424cf51521183bd17f8b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZX=E5=A4=8F=E5=A4=9C=E4=B9=8B=E9=A3=8E?= Date: Thu, 4 Jul 2024 18:10:20 +0800 Subject: [PATCH] Implement overload of requestStreamingInfo --- pom.xml | 2 +- .../kookbc/impl/entity/channel/VoiceChannelImpl.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d22cb04f..3dd4d32e 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ ${java.version} ${java.version} 2.19.0 - 5549fc76 + acac2d30 UTF-8 0.12.4+mixin.0.8.5 9.3 diff --git a/src/main/java/snw/kookbc/impl/entity/channel/VoiceChannelImpl.java b/src/main/java/snw/kookbc/impl/entity/channel/VoiceChannelImpl.java index fe552c96..2c2a4c02 100644 --- a/src/main/java/snw/kookbc/impl/entity/channel/VoiceChannelImpl.java +++ b/src/main/java/snw/kookbc/impl/entity/channel/VoiceChannelImpl.java @@ -195,6 +195,17 @@ public StreamingInfo requestStreamingInfo(@Nullable String password) { return NORMAL_GSON.fromJson(res, StreamingInfoImpl.class); } + @Override + public StreamingInfo requestStreamingInfo(@Nullable String password, boolean rtcpMux) { + final Map body = new MapBuilder() + .put("channel_id", getId()) + .putIfNotNull("password", password) + .put("rtcp_mux", rtcpMux) + .build(); + final JsonObject res = client.getNetworkClient().post(HttpAPIRoute.VOICE_JOIN.toFullURL(), body); + return NORMAL_GSON.fromJson(res, StreamingInfoImpl.class); + } + @Override public StreamingInfo requestStreamingInfo(@Nullable String password, String audioSSRC, String audioPayloadType, boolean rtcpMux) { final Map body = new MapBuilder()