Jaa


MediaControl Class

Definition

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Describes the object that applications register with, to receive media focus and transport control notifications.

public ref class MediaControl abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Media.MediaControlContract, 65536)]
/// [Windows.Foundation.Metadata.Deprecated("MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Media.MediaControlContract)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
class MediaControl final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Media.MediaControlContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
/// [Windows.Foundation.Metadata.Deprecated("MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Media.MediaControlContract")]
class MediaControl final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Media.MediaControlContract), 65536)]
[Windows.Foundation.Metadata.Deprecated("MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Media.MediaControlContract))]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
public static class MediaControl
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Media.MediaControlContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
[Windows.Foundation.Metadata.Deprecated("MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Media.MediaControlContract")]
public static class MediaControl
Public Class MediaControl
Inheritance
Object Platform::Object IInspectable MediaControl
Attributes

Windows requirements

Device family
Windows Desktop Extension SDK (introduced in 10.0.10240.0)
Xbox One Extensions for the UWP (introduced in 10.0.10586.0)
API contract
Windows.Media.MediaControlContract (introduced in v1.0)

Remarks

The MediaControl class provides access to button press events. These events can be monitored, and can modify the response and behavior of an audio-aware app.

Properties

AlbumArt

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Gets or sets the path to the artwork for the album cover.

ArtistName

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Gets or sets the name of the artist.

IsPlaying

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Gets or sets the state of the Play button.

SoundLevel

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Gets the current sound level.

TrackName

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Gets or sets the track name.

Events

ChannelDownPressed

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Event raised when a ChannelDown command is issued to the application.

ChannelUpPressed

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Event raised when a ChannelUp command is issued to the application.

FastForwardPressed

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Event raised when a FastForward command is issued to the application.

NextTrackPressed

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Event raised when a NextTrack command is issued to the application.

PausePressed

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Event raised when a Pause command is issued to the application.

PlayPauseTogglePressed

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Event raised when a PlayPauseToggle command is issued to the application.

PlayPressed

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Event raised when a Play command is issued to the application.

PreviousTrackPressed

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Event raised when a PreviousTrack command is issued to the application.

RecordPressed

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Event raised when a Record command is issued to the application.

RewindPressed

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Event raised when a Rewind command is issued to the application.

SoundLevelChanged

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Event raised when the sound level changes.

StopPressed

Note

MediaControl may be altered or unavailable for releases after Windows 8.1. Instead, use SystemMediaTransportControls.

Event raised when a Stop command is issued to the application.

Applies to

See also