Edit

Share via


Recorder.AttachFlow(AudioVideoFlow) Method

Definition

Attaches an AudioVideoFlow instance to this recorder.

public:
 void AttachFlow(Microsoft::Rtc::Collaboration::AudioVideo::AudioVideoFlow ^ audioVideoFlow);
public void AttachFlow (Microsoft.Rtc.Collaboration.AudioVideo.AudioVideoFlow audioVideoFlow);
member this.AttachFlow : Microsoft.Rtc.Collaboration.AudioVideo.AudioVideoFlow -> unit

Parameters

audioVideoFlow
AudioVideoFlow

The AudioVideoFlow instance to be attached.

Exceptions

Thrown when the audioVideoFlow parameter is null.

Thrown when the recorder is already attached to another AudioVideoFlow instance.

Examples

The following example attaches and detaches a Recorder by the time AudioVideoFlow changes its state to Active and Terminated.

C# Attaching and detaching an AudioVideoFlow.


audioVideoFlow.StateChanged += delegate(object sender, MediaFlowStateChangedEventArgs args)
{
    AudioVideoFlow avFlow = (AudioVideoFlow)sender;

    if(avFlow.State == MediaFlowState.Active)
    {

        Recorder recorder = new Recorder();
        recorder.AttachFlow(avFlow);

    }
    else if(avFlow.State == MediaFlowState.Terminated)
    {

        if (avFlow.Recorder != null)
        {
            avFlow.Recorder.DetachFlow();
        }

    }
};


Applies to