MediaPlaybackList MediaPlaybackList MediaPlaybackList MediaPlaybackList MediaPlaybackList Class

Definition

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

public : sealed class MediaPlaybackList : IMediaPlaybackSource
struct winrt::Windows::Media::Playback::MediaPlaybackList : IMediaPlaybackSource
public sealed class MediaPlaybackList : IMediaPlaybackSource
Public NotInheritable Class MediaPlaybackList Implements IMediaPlaybackSource
var mediaPlaybackList = new mediaPlaybackList();
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Items in a MediaPlaybackList are rendered using gapless playback. The system will use provided metadata in MP3 or AAC encoded files to determine the delay or padding compensation needed for gapless playback. If the MP3 or AAC encoded files don't provide this metadata, then the system determines the delay or padding heuristically. For lossless formats, such as PCM, FLAC, or ALAC, the system takes no action because these encoders don't introduce delay or padding.

For how-to guidance for working with media items, see Media items, playlists, and tracks.

Version history

Windows version SDK version Value added
1511 10586 MaxPrefetchTime
1511 10586 SetShuffledItems
1511 10586 ShuffledItems
1511 10586 StartingItem
1703 15063 MaxPlayedItemsToKeepOpen

Constructors

MediaPlaybackList() MediaPlaybackList() MediaPlaybackList() MediaPlaybackList() MediaPlaybackList()

Initializes a new instance of the MediaPlaybackList class.

Properties

AutoRepeatEnabled AutoRepeatEnabled AutoRepeatEnabled AutoRepeatEnabled AutoRepeatEnabled

Gets or sets a value indicating whether the playback list will loop when the end of the list is reached.

CurrentItem CurrentItem CurrentItem CurrentItem CurrentItem

Gets the currently playing MediaPlaybackItem.

CurrentItemIndex CurrentItemIndex CurrentItemIndex CurrentItemIndex CurrentItemIndex

Gets the index of the current item in theMediaPlaybackList.

Items Items Items Items Items

Gets an IObservableVector representation of the playback list.

MaxPlayedItemsToKeepOpen MaxPlayedItemsToKeepOpen MaxPlayedItemsToKeepOpen MaxPlayedItemsToKeepOpen MaxPlayedItemsToKeepOpen

Gets or sets a value that specifies the number of MediaPlaybackItem objects that should be kept open after they have been played.

MaxPrefetchTime MaxPrefetchTime MaxPrefetchTime MaxPrefetchTime MaxPrefetchTime

Gets or sets the maximum time before a MediaPlaybackItem in the list is expected to play that the media content associated with the item is retrieved.

ShuffledItems ShuffledItems ShuffledItems ShuffledItems ShuffledItems

Gets a read-only list of MediaPlaybackItem objects that will be played in shuffle mode, in the order in which they will be played.

ShuffleEnabled ShuffleEnabled ShuffleEnabled ShuffleEnabled ShuffleEnabled

Gets or sets a value indicating whether the items in the playback list are played in a random order.

StartingItem StartingItem StartingItem StartingItem StartingItem

Gets or sets the MediaPlaybackItem that will be played first.

Methods

MoveNext() MoveNext() MoveNext() MoveNext() MoveNext()

Changes the current item of the MediaPlaybackList to the next item in the list.

MovePrevious() MovePrevious() MovePrevious() MovePrevious() MovePrevious()

Changes the current item of the MediaPlaybackList to the previous item in the list.

MoveTo(UInt32) MoveTo(UInt32) MoveTo(UInt32) MoveTo(UInt32) MoveTo(UInt32)

Changes the current item of the MediaPlaybackList to the item with the specified index.

SetShuffledItems(IIterable<MediaPlaybackItem>) SetShuffledItems(IIterable<MediaPlaybackItem>) SetShuffledItems(IIterable<MediaPlaybackItem>) SetShuffledItems(IIterable<MediaPlaybackItem>) SetShuffledItems(IIterable<MediaPlaybackItem>)

Sets the list of MediaPlaybackItem objects that will be played in shuffle mode, in the order in which they will be played.

Events

CurrentItemChanged CurrentItemChanged CurrentItemChanged CurrentItemChanged CurrentItemChanged

Occurs when the currently playing MediaPlaybackItem changes.

ItemFailed ItemFailed ItemFailed ItemFailed ItemFailed

Occurs when an error is encountered with a MediaPlaybackItem in the playback list.

ItemOpened ItemOpened ItemOpened ItemOpened ItemOpened

Occurs when a MediaPlaybackItem in the playback list is successfully opened.

See also