Edit

Share via


Player.SetSource(MediaSource) Method

Definition

Sets the media source for the player.

public:
 void SetSource(Microsoft::Rtc::Collaboration::AudioVideo::MediaSource ^ source);
public void SetSource (Microsoft.Rtc.Collaboration.AudioVideo.MediaSource source);
member this.SetSource : Microsoft.Rtc.Collaboration.AudioVideo.MediaSource -> unit
Public Sub SetSource (source As MediaSource)

Parameters

source
MediaSource

The media source that is to be bound to the player.

Exceptions

Thrown when the source parameter is null.

Examples

The following example shows a MediaSource being removed and then it sets a new one before starting a player

C# Setting and removing a MediaSource.


// In case no source is set, RemoveSource will be no-op.
player.RemoveSource();



player.SetSource(source);
player.AttachFlow(audioVideoFlow);
player.Start();



Remarks

If the player is already started, SetSource stops it.

Applies to