Dela via


Windows.Media.Playback Namespace

Provides functionality for playing media files from foreground and background tasks.

Classes

BackgroundMediaPlayer

Provides access to the media player while it is running in the background.

Note

Starting with Windows, version 1703, BackgroundMediaPlayer is deprecated and may not be available in future versions of Windows. Use the MediaPlayer class instead. For more information, see Play media in the background.

CurrentMediaPlaybackItemChangedEventArgs

Provides data for the MediaPlaybackList.CurrentItemChanged event.

MediaBreak

Represents a set of one or more MediaPlaybackItem objects that are played before, after, or at specified points during the playback of another MediaPlaybackItem.

MediaBreakEndedEventArgs

Provides data for the MediaBreakManager.BreakEnded event, which occurs when the playback of a MediaBreak has ended.

MediaBreakManager

Provides information about and control over the MediaBreak objects associated with a MediaPlayer. This class provides events for when a media break starts playback, ends playback, is skipped, or is seeked over. You can also use this class to determine the currently playing MediaBreak or to start or skip playback of a MediaBreak.

MediaBreakSchedule

Represents a set of MediaBreak objects associated with a MediaPlaybackItem and the positions within the playback of the item that the media breaks are played.

MediaBreakSeekedOverEventArgs

Provides data for the MediaBreakManager.BreaksSeekedOver event, which occurs when the user seeks the media playback position past one or more pending media breaks.

MediaBreakSkippedEventArgs

Provides data for the MediaBreakManager.BreakSkipped event, which occurs when the playback of a MediaBreak is skipped.

MediaBreakStartedEventArgs

Provides data for the MediaBreakManager.BreakStarted event, which occurs when the playback of a MediaBreak starts.

MediaItemDisplayProperties

Defines a set of metadata for a MediaPlaybackItem that is displayed in the System Media Transport Controls while the item is playing.

MediaPlaybackAudioTrackList

Represents a read-only list of AudioTrack objects, of which a single track can be selected at one time.

MediaPlaybackCommandManager

Specifies the behavior of and receives events from the System Media Transport Controls. Use this class to customize the interaction between a MediaPlayer and the System Media Transport Controls.

MediaPlaybackCommandManagerAutoRepeatModeReceivedEventArgs

Provides data or the MediaPlaybackCommandManager.AutoRepeatModeReceived event, which occurs when the command manager receives a command from the Auto-repeat control of the System Media Transport Controls.

MediaPlaybackCommandManagerCommandBehavior

For use with a MediaPlaybackCommandManager object, this class allows you to enable and disable System Media Transport Controls commands and allows you to respond to changes in the enabled state of a command.

MediaPlaybackCommandManagerFastForwardReceivedEventArgs

Provides data or the MediaPlaybackCommandManager.FastForwardReceived event, which occurs when the command manager receives a command from the Fast-forward button of the System Media Transport Controls.

MediaPlaybackCommandManagerNextReceivedEventArgs

Provides data or the MediaPlaybackCommandManager.NextReceived event, which occurs when the command manager receives a command from the Next button of the System Media Transport Controls.

MediaPlaybackCommandManagerPauseReceivedEventArgs

Provides data or the MediaPlaybackCommandManager.PauseReceived event, which occurs when the command manager receives a command from the Pause button of the System Media Transport Controls.

MediaPlaybackCommandManagerPlayReceivedEventArgs

Provides data or the MediaPlaybackCommandManager.PlayReceived event, which occurs when the command manager receives a command from the Play button of the System Media Transport Controls.

MediaPlaybackCommandManagerPositionReceivedEventArgs

Provides data or the MediaPlaybackCommandManager.PositionReceived event, which occurs when the command manager receives a command changing the current position from the System Media Transport Controls.

MediaPlaybackCommandManagerPreviousReceivedEventArgs

Provides data or the MediaPlaybackCommandManager.PreviousReceived event, which occurs when the command manager receives a command from the Play button of the System Media Transport Controls.

MediaPlaybackCommandManagerRateReceivedEventArgs

Provides data or the MediaPlaybackCommandManager.RateReceived event, which occurs when the command manager receives a command changing the current playback rate from the System Media Transport Controls.

MediaPlaybackCommandManagerRewindReceivedEventArgs

Provides data or the MediaPlaybackCommandManager.RewindReceived event, which occurs when the command manager receives a command from the Rewind button of the System Media Transport Controls.

MediaPlaybackCommandManagerShuffleReceivedEventArgs

Provides data or the ShuffleReceived event, which occurs when the command manager receives a command from the Shuffle control of the System Media Transport Controls.

MediaPlaybackItem

Represents a media item that can be played back. This class acts as a wrapper around a MediaSource that exposes the audio tracks, video tracks, and timed metadata tracks included in the media source.

MediaPlaybackItemError

Represents an error that occurred trying to resolve a MediaPlaybackItem.

MediaPlaybackItemFailedEventArgs

Provides data for the MediaPlaybackList.ItemFailed event.

MediaPlaybackItemOpenedEventArgs

Provides data for the MediaPlaybackList.ItemOpened event.

MediaPlaybackList

Represents a list of MediaPlaybackItem objects that can be played back. Provides methods for switching the currently playing item and enabling looping and shuffling.

MediaPlaybackSession

Provides information about the state of the current playback session of a MediaPlayer and provides events for responding to changes in playback session state.

MediaPlaybackSessionBufferingStartedEventArgs

Provides data for the BufferingStarted event of a MediaPlaybackSession.

MediaPlaybackSessionOutputDegradationPolicyState

Expresses the current output degradation policy state of a MediaPlaybackSession.

MediaPlaybackSphericalVideoProjection

Manages the spherical video projection settings for a MediaPlaybackSession.

MediaPlaybackTimedMetadataTrackList

Represents a read-only list of TimedMetadataTrack objects.

MediaPlaybackVideoTrackList

Represents a read-only list of VideoTrack objects, of which a single track can be selected at one time.

MediaPlayer

Provides access to media playback functionality such as play, pause, fast-forward, rewind, and volume.

MediaPlayerDataReceivedEventArgs

Provides data for the MessageReceivedFromBackground and MessageReceivedFromForeground events.

MediaPlayerFailedEventArgs

Provides the data for MediaFailed events.

MediaPlayerRateChangedEventArgs

Provides the data for MediaPlayerRateChanged events.

MediaPlayerSurface

Provides access to a ICompositionSurface that is shared between a MediaPlayer and a Compositor to enable the rendering of MediaPlayer content using the Windows.UI.Composition APIs without requiring the use of the XAML framework.

PlaybackMediaMarker

Represents a marker at specific location in a media stream time-line.

PlaybackMediaMarkerReachedEventArgs

Provides data for PlaybackMediaMarkerReached events.

PlaybackMediaMarkerSequence

An ordered collection of PlaybackMediaMarker objects.

TimedMetadataPresentationModeChangedEventArgs

Provides data for the MediaPlaybackTimedMetadataTrackList.PresentationModeChanged event.

Interfaces

IMediaEnginePlaybackSource

The interface implemented by classes that are Media Engine playback sources.

IMediaPlaybackSource

A marker interface that identifies the implementing class as a playback source.

Enums

AutoLoadedDisplayPropertyKind

Specifies the kinds of metadata that can be automatically displayed for a MediaPlaybackItem. Set the type of data you want to be automatically loaded by assigning one of these values to the AutoLoadedDisplayProperties properties.

FailedMediaStreamKind

Indicates the type of media stream that failed.

MediaBreakInsertionMethod

Specifies the method that is used to insert the MediaBreak playback into the playback of the MediaPlaybackItem to which it belongs.

MediaCommandEnablingRule

Specifies a rule for enabling a System Media Transport Controls command.

MediaPlaybackItemChangedReason

Specifies the reason why the current MediaPlaybackItem in a MediaPlaybackList changed. Check for the reason by accessing the Reason property of the CurrentMediaPlaybackItemChangedEventArgs object passed into the MediaPlaybackList.CurrentItemChanged event.

MediaPlaybackItemErrorCode

Specifies the type of error that occurred while opening a MediaPlaybackItem.

MediaPlaybackSessionVideoConstrictionReason

Specifies the policy-based reason that video output of a media item is constricted.

MediaPlaybackState

Specifies the playback state of a MediaPlaybackSession.

MediaPlayerAudioCategory

Specifies the types of audio that can be played by a media player.

MediaPlayerAudioDeviceType

Describes the primary usage of the device that is being used to play back audio. This value is used by MediaPlayer.AudioDeviceType.

MediaPlayerError

Indicates possible media player errors.

MediaPlayerState

Indicates the possible states that the player can be in.

Note

MediaPlayerState may be altered or unavailable after Windows 10, version 1607. Use MediaPlaybackState instead.

SphericalVideoProjectionMode

Specifies the spherical projection mode used for rendering video.

StereoscopicVideoRenderMode

Specifies the current stereoscopic render mode for a MediaPlayer.

TimedMetadataTrackPresentationMode

Specifies whether a set of timed metadata tracks are listed in the XAML **MediaTransportControls, whether events are raised for data cues in the tracks, and whether any subtitles and closed captions contained in the tracks are displayed by the system, by the app, or not at all.

See also