Player.SetSource Method
Sets the media source for the player.
Namespace: Microsoft.Rtc.Collaboration.AudioVideo
Assembly: Microsoft.Rtc.Collaboration (in Microsoft.Rtc.Collaboration.dll)
Syntax
'Declaration
Public Sub SetSource ( _
source As MediaSource _
)
'Usage
Dim instance As Player
Dim source As MediaSource
instance.SetSource(source)
public void SetSource(
MediaSource source
)
Parameters
- source
Type: Microsoft.Rtc.Collaboration.AudioVideo.MediaSource
The media source that is to be bound to the player.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when the source parameter is null. |
Remarks
If the player is already started, SetSource stops it.
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();