Edit

Share via


Player Class

Definition

The Player class represents an entity capable of playing media.

public ref class Player
public class Player
type Player = class
Public Class Player
Inheritance
Player

Remarks

The input to a player comes from a media source, which is an instance of a subclass of the MediaSource class. The output from a player goes to one or more AudioVideoFlow instances. A player can attach any AudioVideoFlow instance.

The Player class provides a simple, scalable way to play a single prompt to multiple AudioVideoFlow instances. A player can be thought of as a pointer to the media source, which determines the current play position in the media.

If multiple players are attached to a media source, a single instance of media will have multiple playing points. This is useful when a single prompt is played to independent AudioVideoFlow instances from the prompt beginning (playing a welcome prompt for an automated server, for example).

A player with a single media source and multiple AudioVideoFlow instances can play a prompt with a single play position. All attached AudioVideoFlow instances receive exactly the same prompt at same time. This is useful for Music on Hold.

Constructors

Player()

Creates a new instance of the Player class.

Properties

AudioVideoFlows

Gets a read-only collection of AudioVideoFlow instances that are attached to the player.

Mode

Gets the player's current mode.

PlaybackSpeed

Gets or sets the player's playback speed.

Source

Gets the player's current media source.

State

Gets the player's current state.

Methods

AttachFlow(AudioVideoFlow)

Attaches an AudioVideoFlow instance to this player.

DetachFlow(AudioVideoFlow)

Detaches an AudioVideoFlow instance from this player.

Pause()

Pauses playing the media source.

RemoveSource()

Removes the currently attached media source from this player.

SetMode(PlayerMode)

Sets the player's mode.

SetSource(MediaSource)

Sets the media source for the player.

Skip(Int32)

Skips the specified number of milliseconds in the media source.

Start()

Starts and resume playing the attached media source.

Stop()

Stops playing the media source.

Events

StateChanged

Raised to notify applications that the player state has changed.

Applies to