mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-02-15 12:50:52 +08:00
新增webrtc echo test双向会话示例
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#ifdef ENABLE_WEBRTC
|
||||
#include "../webrtc/WebRtcPlayer.h"
|
||||
#include "../webrtc/WebRtcPusher.h"
|
||||
#include "../webrtc/WebRtcEchoTest.h"
|
||||
#endif
|
||||
|
||||
using namespace toolkit;
|
||||
@@ -1271,6 +1272,14 @@ void installWebApi() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strcasecmp(type.data(), "echo")) {
|
||||
auto rtc = WebRtcEchoTest::create(EventPollerPool::Instance().getPoller());
|
||||
val["sdp"] = rtc->getAnswerSdp(offer_sdp);
|
||||
val["type"] = "answer";
|
||||
invoker(200, headerOut, val.toStyledString());
|
||||
return;
|
||||
}
|
||||
|
||||
throw ApiRetException("不支持该类型", API::InvalidArgs);
|
||||
});
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user