mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-23 15:48:03 +00:00
Fixed client build
This commit is contained in:
@ -51,9 +51,9 @@ int main(int argc, char **argv) {
|
||||
ws->onMessage([wpc = make_weak_ptr(pc)](const std::variant<binary, string> &data) {
|
||||
auto pc = wpc.lock();
|
||||
if (pc && holds_alternative<string>(data)) {
|
||||
json message = json::parse(data.get<string>());
|
||||
if (auto it = message.find("type")) {
|
||||
auto type = it->second.get<string>();
|
||||
json message = json::parse(get<string>(data));
|
||||
if (auto it = message.find("type"); it != message.end()) {
|
||||
auto type = it->get<string>();
|
||||
if (type == "offer" || type == "answer") {
|
||||
auto str = message["description"].get<string>();
|
||||
pc->setRemoteDescription(Description(str, type));
|
||||
|
Reference in New Issue
Block a user