Video now has to be manually activated in order to watch it
This commit is contained in:
@@ -639,6 +639,10 @@ command_result SpeakingClient::handleCommand(Command &command) {
|
||||
return this->handleCommandRtcBroadcast(command);
|
||||
} else if(command.command() == "rtcsessionreset") {
|
||||
return this->handleCommandRtcSessionReset(command);
|
||||
} else if(command.command() == "broadcastvideojoin") {
|
||||
return this->handleCommandBroadcastVideoJoin(command);
|
||||
} else if(command.command() == "broadcastvideoleave") {
|
||||
return this->handleCommandBroadcastVideoLeave(command);
|
||||
}
|
||||
}
|
||||
return ConnectedClient::handleCommand(command);
|
||||
@@ -747,4 +751,41 @@ command_result SpeakingClient::handleCommandRtcBroadcast(Command &command) {
|
||||
}
|
||||
}
|
||||
return ts::command_result{std::move(result)};
|
||||
}
|
||||
|
||||
command_result SpeakingClient::handleCommandBroadcastVideoJoin(Command &cmd) {
|
||||
CMD_REQ_SERVER;
|
||||
CMD_CHK_AND_INC_FLOOD_POINTS(25);
|
||||
|
||||
auto broadcast_type = (rtc::VideoBroadcastType) cmd["bt"].as<uint8_t>();
|
||||
auto broadcast_id = cmd["bid"].as<uint32_t>();
|
||||
|
||||
using VideoBroadcastJoinResult = rtc::VideoBroadcastJoinResult;
|
||||
switch(this->server->rtc_server().join_video_broadcast(this->rtc_client_id, broadcast_id, broadcast_type)) {
|
||||
case VideoBroadcastJoinResult::Success:
|
||||
return ts::command_result{error::ok};
|
||||
|
||||
case VideoBroadcastJoinResult::InvalidBroadcast:
|
||||
return ts::command_result{error::broadcast_invalid_id};
|
||||
|
||||
case VideoBroadcastJoinResult::InvalidBroadcastType:
|
||||
return ts::command_result{error::broadcast_invalid_type};
|
||||
|
||||
case VideoBroadcastJoinResult::InvalidClient:
|
||||
return ts::command_result{error::client_invalid_id};
|
||||
|
||||
case VideoBroadcastJoinResult::UnknownError:
|
||||
default:
|
||||
return ts::command_result{error::vs_critical};
|
||||
}
|
||||
}
|
||||
|
||||
command_result SpeakingClient::handleCommandBroadcastVideoLeave(Command &cmd) {
|
||||
CMD_REQ_SERVER;
|
||||
|
||||
auto broadcast_type = (rtc::VideoBroadcastType) cmd["bt"].as<uint8_t>();
|
||||
auto broadcast_id = cmd["bid"].as<uint32_t>();
|
||||
|
||||
this->server->rtc_server().leave_video_broadcast(this->rtc_client_id, broadcast_id, broadcast_type);
|
||||
return ts::command_result{error::ok};
|
||||
}
|
||||
Reference in New Issue
Block a user