Dela via


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 ref class MediaPlaybackList sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class MediaPlaybackList final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class MediaPlaybackList final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class MediaPlaybackList
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class MediaPlaybackList
function MediaPlaybackList()
Public NotInheritable Class MediaPlaybackList
Inheritance
Object Platform::Object IInspectable MediaPlaybackList
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

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()

Initializes a new instance of the MediaPlaybackList class.

Properties

AutoRepeatEnabled

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

CurrentItem

Gets the currently playing MediaPlaybackItem.

CurrentItemIndex

Gets the index of the current item in theMediaPlaybackList.

Items

Gets an IObservableVector representation of the playback list.

MaxPlayedItemsToKeepOpen

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

MaxPrefetchTime

Gets or sets the maximum prefetch time for MediaPlaybackItem objects in the playback list. The prefetch time is the amount of time before an item is expected to begin playing that the system retrieves the item's media content.

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

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

StartingItem

Gets or sets the MediaPlaybackItem that will be played first.

Methods

MoveNext()

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

MovePrevious()

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

MoveTo(UInt32)

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

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

Occurs when the currently playing MediaPlaybackItem changes.

ItemFailed

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

ItemOpened

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

Applies to

See also