[][src]Function skyway_webrtc_gateway_api::media::answer

pub async fn answer<'_, '_>(
    media_connection_id: &'_ MediaConnectionId,
    params: &'_ AnswerQuery
) -> Result<AnswerResponse, Error>

Have WebRTC Gateway accept to a request of establishing MediaConnection from neighbours.

It's bindings for POST /media/connections/{media_connection_id}/answer

API

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::new("mc-example");
    let query = AnswerQuery {
        constraints: Constraints {
            video: true,
            videoReceiveEnabled: Some(false),
            audio: false,
            audioReceiveEnabled: Some(false),
            video_params: None,
            audio_params: None,
        },
        redirect_params: None,
    };
    let result = answer(&media_connection_id, &query).await;
}