次の方法で共有


AudioVideoFlow.ConfigurationChanged Event

Raised by an AudioVideoFlow instance when any configuration has changed.

Namespace:  Microsoft.Rtc.Collaboration.AudioVideo
Assembly:  Microsoft.Rtc.Collaboration (in Microsoft.Rtc.Collaboration.dll)

Syntax

'Declaration
Public Event ConfigurationChanged As EventHandler(Of AudioVideoFlowConfigurationChangedEventArgs)
'Usage
Dim instance As AudioVideoFlow
Dim handler As EventHandler(Of AudioVideoFlowConfigurationChangedEventArgs)

AddHandler instance.ConfigurationChanged, handler
public event EventHandler<AudioVideoFlowConfigurationChangedEventArgs> ConfigurationChanged

Remarks

Configuration changes occur when there is a change in the media flow that causes renegotiation to occur. Such a change can be the result of actions by the AudioVideoFlow instance, actions by the remote user, or by changes in the state of the media flow.

AudioVideoFlow-related changes that can cause renegotiation:

  • Calls to BeginHold and EndHold (which affect HoldStatus)

  • Calls to BeginRetrieve and EndRetrieve (which affect HoldStatus)

  • Calls to BeginApplyChanges and EndApplyChanges (which affect the TonePolicy and ToneEnabled properties on the AudioVideoFlow instance; the AllowedDirection, Direction, SamplingRate, and HighPerformance properties on the associated media channel )

Changes from the remote endpoint that can cause renegotiation:

  • Changes to Direction property on the media channel

  • Changes to the ToneEnabled property on the AudioVideoFlow instance

Internal configuration changes that can cause renegotiation:

  • A change in the State property on the media flow (Idle to Active, Idle to Terminated, or Active to Terminated)

  • The remote endpoint terminated the call.

  • A user terminated the call.

Configuration changes that do not involve renegotiation, and so do not cause ConfigurationChanged to be raised:

  • Attaching or detaching a device

  • Muting or unmuting the audio

Examples

The following example subscribes to AudioVideoFlowConfigurationRequested, and when event is received it disconnects the call if audio channel direction is different than SendReceive or Inactive.

C# Subscribing to AudioVideoFlowConfigurationRequested.

 

            audioVideoFlow.ConfigurationChanged += delegate(object sender, AudioVideoFlowConfigurationChangedEventArgs arg)
            {
                AudioVideoFlow avFlow = (AudioVideoFlow)sender;

                // check directions
                AudioChannel audioChannel = (AudioChannel)avFlow.Audio.GetChannels()[ChannelLabel.AudioMono];
                if ((audioChannel.Direction != MediaChannelDirection.SendReceive)
                    && (audioChannel.Direction != MediaChannelDirection.Inactive))
                {
                    AudioVideoCall call = avFlow.Call;
                    call.EndTerminate(call.BeginTerminate(null, null));
                }
            };


See Also

Reference

AudioVideoFlow Class

AudioVideoFlow Members

Microsoft.Rtc.Collaboration.AudioVideo Namespace