Edit

Share via


MediaChannelTemplate.AllowedDirection Property

Definition

Gets or sets the stream allowed direction.

public:
 property Microsoft::Rtc::Collaboration::AudioVideo::MediaChannelDirection AllowedDirection { Microsoft::Rtc::Collaboration::AudioVideo::MediaChannelDirection get(); void set(Microsoft::Rtc::Collaboration::AudioVideo::MediaChannelDirection value); };
public Microsoft.Rtc.Collaboration.AudioVideo.MediaChannelDirection AllowedDirection { get; set; }
member this.AllowedDirection : Microsoft.Rtc.Collaboration.AudioVideo.MediaChannelDirection with get, set
Public Property AllowedDirection As MediaChannelDirection

Property Value

Exceptions

Thrown when assigned value is not defined in enumerated type.

Examples

The following example changes AllowedDirection and applies it to an AudioVideoFlow.

C# Modifying AudioChannelTemplate properties.


AudioVideoFlowTemplate templateToApply = new AudioVideoFlowTemplate(audioVideoFlow);
AudioChannelTemplate audioChannelTemplate = (AudioChannelTemplate)templateToApply.Audio.GetChannels()[ChannelLabel.AudioMono];
audioChannelTemplate.AllowedDirection = MediaChannelDirection.SendOnly;
audioChannelTemplate.SendDirectionSamplingRate = AudioSamplingRate.EightKhz;

// ApplyChanges
audioVideoFlow.BeginApplyChanges(
    templateToApply,
    new AsyncCallback(delegate(IAsyncResult result)
    {
        try
        {
            audioVideoFlow.EndApplyChanges(result);
        }
        catch (RealTimeException e)
        {
            // handle exception
            throw e;
        }

        // ApplyChanges is done, verify changes result..
        AudioChannel audioChannel = audioVideoFlow.Audio.GetChannels()[ChannelLabel.AudioMono];
        if (audioChannel.Direction == MediaChannelDirection.SendOnly &&
            audioChannel.SendDirectionSamplingRate == AudioSamplingRate.EightKhz)
        {
            // remote side accepted changes as they were
        }
        else
        {
            // remote side accepted changes but filtered them more.
        }
    }),
    this);



Applies to