SystemMediaTransportControls SystemMediaTransportControls SystemMediaTransportControls SystemMediaTransportControls Class

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

Syntax

Declaration

public sealed class SystemMediaTransportControlspublic sealed class SystemMediaTransportControlsPublic NotInheritable Class SystemMediaTransportControls

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 summary

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

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

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

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

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

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

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

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

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

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

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

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

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

Gets or sets the playback rate of the SystemMediaTransportControls.

Gets the playback status of the media.

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

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

Methods summary

The system transport controls for the current view.

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

Events summary

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

Occurs when a button is pressed on the SystemMediaTransportControls.

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

Occurs when the user modifies the SystemMediaTransportControls playback rate.

Occurs when a property on the SystemMediaTransportControls has changed.

Occurs when the user modifies the SystemMediaTransportControls shuffle state.

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 MediaPlaybackAutoRepeatMode

    Property Value

  • 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 SystemMediaTransportControlsDisplayUpdater

    Property Value

  • 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 bool

    Property Value

    • bool
      bool
      bool
      bool

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

  • 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 bool

    Property Value

    • bool
      bool
      bool
      bool

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

  • 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 bool

    Property Value

    • bool
      bool
      bool
      bool

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

    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 bool

    Property Value

    • bool
      bool
      bool
      bool

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

  • 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 bool

    Property Value

    • bool
      bool
      bool
      bool

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

  • 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 bool

    Property Value

    • bool
      bool
      bool
      bool

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

  • 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 bool

    Property Value

    • bool
      bool
      bool
      bool

      true if the play is supported; otherwise, false.

  • 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 bool

    Property Value

    • bool
      bool
      bool
      bool

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

  • 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 bool

    Property Value

    • bool
      bool
      bool
      bool

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

  • 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 bool

    Property Value

    • bool
      bool
      bool
      bool

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

  • 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 bool

    Property Value

    • bool
      bool
      bool
      bool

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

  • 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 double

    Property Value

  • PlaybackStatus
    PlaybackStatus
    PlaybackStatus
    PlaybackStatus

    Gets the playback status of the media.

    public MediaPlaybackStatus PlaybackStatus { get; set; }public MediaPlaybackStatus PlaybackStatus { get; set; }Public ReadWrite Property PlaybackStatus As MediaPlaybackStatus

    Property Value

  • 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 bool

    Property Value

  • 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 SoundLevel

    Property Value

    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

Events

  • AutoRepeatModeChangeRequested
    AutoRepeatModeChangeRequested
    AutoRepeatModeChangeRequested
    AutoRepeatModeChangeRequested

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

    public event TypedEventHandler AutoRepeatModeChangeRequestedpublic event TypedEventHandler AutoRepeatModeChangeRequestedPublic Event AutoRepeatModeChangeRequested

    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 ButtonPressed

    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 PlaybackPositionChangeRequested

    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(Windows.Media.SystemMediaTransportControlsTimelineProperties).

  • PlaybackRateChangeRequested
    PlaybackRateChangeRequested
    PlaybackRateChangeRequested
    PlaybackRateChangeRequested

    Occurs when the user modifies the SystemMediaTransportControls playback rate.

    public event TypedEventHandler PlaybackRateChangeRequestedpublic event TypedEventHandler PlaybackRateChangeRequestedPublic Event PlaybackRateChangeRequested

    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 PropertyChanged

    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 ShuffleEnabledChangeRequested

    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.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.MuseAttribute
Windows.Foundation.Metadata.ThreadingAttribute

Details

Assembly

Windows.Media.dll