SystemMediaTransportControls SystemMediaTransportControls SystemMediaTransportControls SystemMediaTransportControls Class

Definition

Represents an object that enables integrate with the system media transport controls and support for media commands.

public sealed class SystemMediaTransportControlspublic sealed class SystemMediaTransportControlsPublic NotInheritable Class SystemMediaTransportControlspublic sealed class SystemMediaTransportControls
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The SystemMediaTransportControls replaces the MediaControl class. In Windows 8.1 and later, you should use this control instead of MediaControl to interact with the system transport controls. The system transport controls enable music application developers to hook into a system-wide transport control. The system transport control allows a user to control a music application that is in the background as well as get and set the current information on which track is playing.

Starting with Windows 10, version 1607, UWP apps that use the MediaPlayer class or AudioGraph class to play media are automatically integrated with the SMTC by default. Simply instantiate a new instance of MediaPlayer and assign a MediaSource, MediaPlaybackItem, or MediaPlaybackList to the player's Source property and the user will see your app name in the SMTC and can play, pause, and move through your playback lists by using the SMTC controls. Get an instance of the SMTC by accessing the MediaPlayer object's SystemMediaTransportControls property. For how-to guidance on using the SMTC from your app, see Integrate with the SystemMediaTransportControls.

For some scenarios, you may want to disable automatic integration with the SMTC. In this case, you should disable the MediaPlayer object's CommandManager by setting the IsEnabled property to false. Call GetForCurrentView() to get an instance of the SystemMediaTransportControls for current view. You will also need to get an instance this way if you are targeting an older version of Windows. For how-to guidance on manually controlling the SMTC, see Manual control of the System Media Transport Controls.

Properties

AutoRepeatMode AutoRepeatMode AutoRepeatMode AutoRepeatMode

Gets or sets a value representing the current auto-repeat mode of the SystemMediaTransportControls.

public MediaPlaybackAutoRepeatMode AutoRepeatMode { get; set; }public MediaPlaybackAutoRepeatMode AutoRepeatMode { get; set; }Public ReadWrite Property AutoRepeatMode As MediaPlaybackAutoRepeatModepublic MediaPlaybackAutoRepeatMode AutoRepeatMode { get; set; }
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

DisplayUpdater DisplayUpdater DisplayUpdater DisplayUpdater

Gets the display updater for the SystemMediaTransportControls which enable updating the information displayed about the currently playing song.

public SystemMediaTransportControlsDisplayUpdater DisplayUpdater { get; }public SystemMediaTransportControlsDisplayUpdater DisplayUpdater { get; }Public ReadOnly Property DisplayUpdater As SystemMediaTransportControlsDisplayUpdaterpublic SystemMediaTransportControlsDisplayUpdater DisplayUpdater { get; }
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsChannelDownEnabled IsChannelDownEnabled IsChannelDownEnabled IsChannelDownEnabled

Gets or sets a value that specifies if the channel down button is supported.

public bool IsChannelDownEnabled { get; set; }public bool IsChannelDownEnabled { get; set; }Public ReadWrite Property IsChannelDownEnabled As boolpublic bool IsChannelDownEnabled { get; set; }
Value
bool bool bool bool

true if the channel down button is supported; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsChannelUpEnabled IsChannelUpEnabled IsChannelUpEnabled IsChannelUpEnabled

Gets or sets a value that specifies if the channel up button is supported.

public bool IsChannelUpEnabled { get; set; }public bool IsChannelUpEnabled { get; set; }Public ReadWrite Property IsChannelUpEnabled As boolpublic bool IsChannelUpEnabled { get; set; }
Value
bool bool bool bool

true if the channel up button is supported; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsEnabled IsEnabled IsEnabled IsEnabled

Enables and disables the system media transport controls for the app.

public bool IsEnabled { get; set; }public bool IsEnabled { get; set; }Public ReadWrite Property IsEnabled As boolpublic bool IsEnabled { get; set; }
Value
bool bool bool bool

true if the system transport controls are enabled for the app; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Setting IsEnabled to false will disable the apps support for the system media transport controls, so the controls will not show. Setting IsEnabled to true will re-enable the controls for the app.

IsFastForwardEnabled IsFastForwardEnabled IsFastForwardEnabled IsFastForwardEnabled

Gets or sets a value that specifies if the fast forward button is supported.

public bool IsFastForwardEnabled { get; set; }public bool IsFastForwardEnabled { get; set; }Public ReadWrite Property IsFastForwardEnabled As boolpublic bool IsFastForwardEnabled { get; set; }
Value
bool bool bool bool

true if the fast forward button is supported; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsNextEnabled IsNextEnabled IsNextEnabled IsNextEnabled

Gets or sets a value that specifies if the next button is supported.

public bool IsNextEnabled { get; set; }public bool IsNextEnabled { get; set; }Public ReadWrite Property IsNextEnabled As boolpublic bool IsNextEnabled { get; set; }
Value
bool bool bool bool

true if the next button is supported; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsPauseEnabled IsPauseEnabled IsPauseEnabled IsPauseEnabled

Gets or sets a value that specifies if the pause button is supported.true if the pause button is supported; otherwise, false.

public bool IsPauseEnabled { get; set; }public bool IsPauseEnabled { get; set; }Public ReadWrite Property IsPauseEnabled As boolpublic bool IsPauseEnabled { get; set; }
Value
bool bool bool bool

true if the pause button is supported; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsPlayEnabled IsPlayEnabled IsPlayEnabled IsPlayEnabled

Gets or sets a value that specifies if the play button is supported.

public bool IsPlayEnabled { get; set; }public bool IsPlayEnabled { get; set; }Public ReadWrite Property IsPlayEnabled As boolpublic bool IsPlayEnabled { get; set; }
Value
bool bool bool bool

true if the play is supported; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsPreviousEnabled IsPreviousEnabled IsPreviousEnabled IsPreviousEnabled

Gets or sets a value that specifies if the previous button is supported.

public bool IsPreviousEnabled { get; set; }public bool IsPreviousEnabled { get; set; }Public ReadWrite Property IsPreviousEnabled As boolpublic bool IsPreviousEnabled { get; set; }
Value
bool bool bool bool

true if the previous button is supported; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsRecordEnabled IsRecordEnabled IsRecordEnabled IsRecordEnabled

Gets or sets a value that specifies if the record button is supported.true if the record button is supported; otherwise, false.

public bool IsRecordEnabled { get; set; }public bool IsRecordEnabled { get; set; }Public ReadWrite Property IsRecordEnabled As boolpublic bool IsRecordEnabled { get; set; }
Value
bool bool bool bool

true if the record button is supported; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsRewindEnabled IsRewindEnabled IsRewindEnabled IsRewindEnabled

Gets or sets a value that specifies if the rewind button is supported.

public bool IsRewindEnabled { get; set; }public bool IsRewindEnabled { get; set; }Public ReadWrite Property IsRewindEnabled As boolpublic bool IsRewindEnabled { get; set; }
Value
bool bool bool bool

true if the rewind button is supported; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsStopEnabled IsStopEnabled IsStopEnabled IsStopEnabled

Gets or sets a value that specifies if the stop button is supported.

public bool IsStopEnabled { get; set; }public bool IsStopEnabled { get; set; }Public ReadWrite Property IsStopEnabled As boolpublic bool IsStopEnabled { get; set; }
Value
bool bool bool bool

true if the stop button is supported; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

PlaybackRate PlaybackRate PlaybackRate PlaybackRate

Gets or sets the playback rate of the SystemMediaTransportControls.

public double PlaybackRate { get; set; }public double PlaybackRate { get; set; }Public ReadWrite Property PlaybackRate As doublepublic double PlaybackRate { get; set; }
Value
double double double double

The playback rate of the SystemMediaTransportControls.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

PlaybackStatus PlaybackStatus PlaybackStatus PlaybackStatus

Gets or sets the playback status of the media.

public MediaPlaybackStatus PlaybackStatus { get; set; }public MediaPlaybackStatus PlaybackStatus { get; set; }Public ReadWrite Property PlaybackStatus As MediaPlaybackStatuspublic MediaPlaybackStatus PlaybackStatus { get; set; }
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

ShuffleEnabled ShuffleEnabled ShuffleEnabled ShuffleEnabled

Gets or sets a value representing the current shuffle state of the SystemMediaTransportControls.

public bool ShuffleEnabled { get; set; }public bool ShuffleEnabled { get; set; }Public ReadWrite Property ShuffleEnabled As boolpublic bool ShuffleEnabled { get; set; }
Value
bool bool bool bool

True if the SystemMediaTransportControls have shuffle enabled; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

SoundLevel SoundLevel SoundLevel SoundLevel

Gets the sound level of the media for the capture and render streams.

public SoundLevel SoundLevel { get; }public SoundLevel SoundLevel { get; }Public ReadOnly Property SoundLevel As SoundLevelpublic SoundLevel SoundLevel { get; }
Value
SoundLevel SoundLevel SoundLevel SoundLevel

The sound level.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Music and media capture apps should monitor the SoundLevel to determine whether the audio streams on the app have been SoundLevel. For apps using the MediaCapture object, capture will be automatically stopped when the capture streams of the app are muted. Capture is not re-started automatically when the audio streams are unmuted, so the SoundLevel changed notification can be used to restart capture. Use the PropertyChanged event to determine when the SoundLevel property changes.

Methods

GetForCurrentView() GetForCurrentView() GetForCurrentView() GetForCurrentView()

The system transport controls for the current view.

public static SystemMediaTransportControls GetForCurrentView()public static SystemMediaTransportControls GetForCurrentView()Public Static Function GetForCurrentView() As SystemMediaTransportControlspublic static SystemMediaTransportControls GetForCurrentView()
Returns
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

UpdateTimelineProperties(SystemMediaTransportControlsTimelineProperties) UpdateTimelineProperties(SystemMediaTransportControlsTimelineProperties) UpdateTimelineProperties(SystemMediaTransportControlsTimelineProperties) UpdateTimelineProperties(SystemMediaTransportControlsTimelineProperties)

Updates the SystemMediaTransportControls timeline properties with the values in the provided object.

public void UpdateTimelineProperties(SystemMediaTransportControlsTimelineProperties timelineProperties)public void UpdateTimelineProperties(SystemMediaTransportControlsTimelineProperties timelineProperties)Public Function UpdateTimelineProperties(timelineProperties As SystemMediaTransportControlsTimelineProperties) As voidpublic void UpdateTimelineProperties(SystemMediaTransportControlsTimelineProperties timelineProperties)
Parameters
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Events

AutoRepeatModeChangeRequested AutoRepeatModeChangeRequested AutoRepeatModeChangeRequested AutoRepeatModeChangeRequested

Occurs when the user modifies the SystemMediaTransportControls auto-repeat mode.

public event TypedEventHandler AutoRepeatModeChangeRequestedpublic event TypedEventHandler AutoRepeatModeChangeRequestedPublic Event AutoRepeatModeChangeRequestedpublic event TypedEventHandler AutoRepeatModeChangeRequested
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Registering for this event causes an app to be notified when the SystemMediaTransportControls auto-repeat mode changes. An app can change its auto-repeat behavior based on the request or ignore the request and update the SystemMediaTransportControls by setting the MediaPlaybackAutoRepeatMode property to a value that reflects the app's actual auto-repeat state.

ButtonPressed ButtonPressed ButtonPressed ButtonPressed

Occurs when a button is pressed on the SystemMediaTransportControls.

public event TypedEventHandler ButtonPressedpublic event TypedEventHandler ButtonPressedPublic Event ButtonPressedpublic event TypedEventHandler ButtonPressed
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Starting with Windows 10, version 1607, UWP apps that use the MediaPlayer class or AudioGraph class to play media are automatically integrated with the SMTC by default. For some scenarios, you may want to manually control the SMTC. In this case, you should ButtonPressed event to be notified that the user has pressed one of the SMTC buttons. For how-to guidance on manually controlling the SMTC, see Manual control of the System Media Transport Controls.

PlaybackPositionChangeRequested PlaybackPositionChangeRequested PlaybackPositionChangeRequested PlaybackPositionChangeRequested

Occurs when the user modifies the playback position of the SystemMediaTransportControls.

public event TypedEventHandler PlaybackPositionChangeRequestedpublic event TypedEventHandler PlaybackPositionChangeRequestedPublic Event PlaybackPositionChangeRequestedpublic event TypedEventHandler PlaybackPositionChangeRequested
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Registering for this event causes an app to be notified when the SystemMediaTransportControls playback position changes. An app can change its auto-repeat behavior based on the request or ignore the request and update the SystemMediaTransportControls by populating a SystemMediaTransportControlsTimelineProperties object with values indicating the actual playback position and calling UpdateTimelineProperties(SystemMediaTransportControlsTimelineProperties).

PlaybackRateChangeRequested PlaybackRateChangeRequested PlaybackRateChangeRequested PlaybackRateChangeRequested

Occurs when the user modifies the SystemMediaTransportControls playback rate.

public event TypedEventHandler PlaybackRateChangeRequestedpublic event TypedEventHandler PlaybackRateChangeRequestedPublic Event PlaybackRateChangeRequestedpublic event TypedEventHandler PlaybackRateChangeRequested
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Registering for this event causes an app to be notified when the SystemMediaTransportControls playback rate changes. An app can change its playback rate based on the request or ignore the request and update the SystemMediaTransportControls by setting the PlaybackRate property to a value that reflects the app's actual playback rate.

PropertyChanged PropertyChanged PropertyChanged PropertyChanged

Occurs when a property on the SystemMediaTransportControls has changed.

public event TypedEventHandler PropertyChangedpublic event TypedEventHandler PropertyChangedPublic Event PropertyChangedpublic event TypedEventHandler PropertyChanged
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Use the Property value of the event SystemMediaTransportControlsPropertyChangedEventArgs to determine which property has changed.

ShuffleEnabledChangeRequested ShuffleEnabledChangeRequested ShuffleEnabledChangeRequested ShuffleEnabledChangeRequested

Occurs when the user modifies the SystemMediaTransportControls shuffle state.

public event TypedEventHandler ShuffleEnabledChangeRequestedpublic event TypedEventHandler ShuffleEnabledChangeRequestedPublic Event ShuffleEnabledChangeRequestedpublic event TypedEventHandler ShuffleEnabledChangeRequested
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Registering for this event causes an app to be notified when the SystemMediaTransportControls shuffle state changes. An app can change its shuffle state based on the request or ignore the request and update the SystemMediaTransportControls by setting the ShuffleEnabled property to a value that reflects the app's actual shuffle state.