ToneController.AttachFlow(AudioVideoFlow) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Attaches an AudioVideoFlow instance.
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 argument is null.
Thrown when another AudioVideoFlow instance is already attached or when the specified AudioVideoFlow instance is already attached to another ToneController.
Examples
The following example attaches and detaches a ToneController 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)
{
ToneController toneController = new ToneController();
toneController.AttachFlow(avFlow);
}
else if(avFlow.State == MediaFlowState.Terminated)
{
if (avFlow.ToneController != null)
{
avFlow.ToneController.DetachFlow();
}
}
};