Edit

Share via


Recorder.SetSink(MediaSink) Method

Definition

Sets the media sink for this recorder.

public:
 void SetSink(Microsoft::Rtc::Collaboration::AudioVideo::MediaSink ^ sink);
public void SetSink (Microsoft.Rtc.Collaboration.AudioVideo.MediaSink sink);
member this.SetSink : Microsoft.Rtc.Collaboration.AudioVideo.MediaSink -> unit
Public Sub SetSink (sink As MediaSink)

Parameters

sink
MediaSink

The media sink that is recorded to.

Exceptions

Thrown when the sink parameter is null.

Thrown when the sink provided has already been associated with another recorder.

Examples

The following example shows Recorder removing a MediaSink and then setting and starting to record.

C# Removing and setting MediaSink.


// In case no sink is set, RemoveSink will be no-op.
recorder.RemoveSink();



recorder.AttachFlow(audioVideoFlow);
recorder.SetSink(sink);
recorder.Start();



Remarks

If the recorder is not Stopped, SetSink stops it. This method throws an exception if it is called with a media sink associated with another recorder.

Applies to