Function skyway_webrtc_gateway_api::media::answer
source · pub async fn answer(
media_connection_id: &MediaConnectionId,
params: &AnswerQuery
) -> Result<AnswerResponse, Error>
Expand description
Have WebRTC Gateway accept to a request of establishing MediaConnection from neighbours.
It’s bindings for POST /media/connections/{media_connection_id}/answer
Examples
use skyway_webrtc_gateway_api::media::{answer, AnswerQuery, Constraints};
use skyway_webrtc_gateway_api::prelude::MediaConnectionId;
async fn example() {
let media_connection_id = MediaConnectionId::try_create("mc-102127d9-30de-413b-93f7-41a33e39d82b").unwrap();
let query = AnswerQuery {
constraints: Constraints {
video: true,
videoReceiveEnabled: Some(false),
audio: false,
audioReceiveEnabled: Some(false),
video_params: None,
audio_params: None,
metadata: None,
},
redirect_params: None,
};
let result = answer(&media_connection_id, &query).await;
}