MediaPlaybackItem MediaPlaybackItem MediaPlaybackItem MediaPlaybackItem MediaPlaybackItem Class

Definition

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.

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

Windows 10 requirements

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

Remarks

A MediaPlaybackItem can be passed directly to a player such as MediaPlayer, MediaElement or MediaPlayerElement. Or, you can even pass the player a list of multiple media playback items using the MediaPlaybackList class.

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 FindFromMediaSource
1607 14393 MediaPlaybackItem(MediaSource,TimeSpan)
1607 14393 MediaPlaybackItem(MediaSource,TimeSpan,TimeSpan)
1607 14393 ApplyDisplayProperties
1607 14393 BreakSchedule
1607 14393 CanSkip
1607 14393 DurationLimit
1607 14393 GetDisplayProperties
1607 14393 StartTime
1703 15063 AutoLoadedDisplayProperties
1703 15063 IsDisabledInPlaybackList
1703 15063 TotalDownloadProgress

Constructors

MediaPlaybackItem(MediaSource) MediaPlaybackItem(MediaSource) MediaPlaybackItem(MediaSource) MediaPlaybackItem(MediaSource) MediaPlaybackItem(MediaSource)

Initializes a new instance of the MediaPlaybackItem class.

MediaPlaybackItem(MediaSource, TimeSpan) MediaPlaybackItem(MediaSource, TimeSpan) MediaPlaybackItem(MediaSource, TimeSpan) MediaPlaybackItem(MediaSource, TimeSpan) MediaPlaybackItem(MediaSource, TimeSpan)

Initializes a new instance of the MediaPlaybackItem class with a StartTime value indicating the position within the item where playback should begin.

MediaPlaybackItem(MediaSource, TimeSpan, TimeSpan) MediaPlaybackItem(MediaSource, TimeSpan, TimeSpan) MediaPlaybackItem(MediaSource, TimeSpan, TimeSpan) MediaPlaybackItem(MediaSource, TimeSpan, TimeSpan) MediaPlaybackItem(MediaSource, TimeSpan, TimeSpan)

Initializes a new instance of the MediaPlaybackItem class with a StartTime value indicating the position within the item where playback should begin and a DurationLimit value specifying the maximum playback duration of the item.

Properties

AudioTracks AudioTracks AudioTracks AudioTracks AudioTracks

Gets a read-only list of audio tracks in the MediaSource associated with the MediaPlaybackItem.

AutoLoadedDisplayProperties AutoLoadedDisplayProperties AutoLoadedDisplayProperties AutoLoadedDisplayProperties AutoLoadedDisplayProperties

Gets or sets a value that specifies for which types of media content, if any, the system should automatically load metadata to display in the System Media Transport Controls.

BreakSchedule BreakSchedule BreakSchedule BreakSchedule BreakSchedule

Gets the MediaBreakSchedule defining the schedule of media breaks for the MediaPlaybackItem.

CanSkip CanSkip CanSkip CanSkip CanSkip

Gets or sets a value indicating whether the MediaPlaybackItem can be skipped.

DurationLimit DurationLimit DurationLimit DurationLimit DurationLimit

Gets the maximum playback duration of the MediaPlaybackItem.

IsDisabledInPlaybackList IsDisabledInPlaybackList IsDisabledInPlaybackList IsDisabledInPlaybackList IsDisabledInPlaybackList

Gets or sets a value that specifies whether a MediaPlaybackItem is disabled in a MediaPlaybackList.

Source Source Source Source Source

Gets the MediaSource object associated with the MediaPlaybackItem.

StartTime StartTime StartTime StartTime StartTime

Gets the position within the MediaPlaybackItem where playback should begin.

TimedMetadataTracks TimedMetadataTracks TimedMetadataTracks TimedMetadataTracks TimedMetadataTracks

Gets a read-only list of timed metadata tracks in the MediaSource associated with the MediaPlaybackItem.

TotalDownloadProgress TotalDownloadProgress TotalDownloadProgress TotalDownloadProgress TotalDownloadProgress

Gets a value that indicates the proportion of the data for the MediaPlaybackItem that is currently downloaded.

VideoTracks VideoTracks VideoTracks VideoTracks VideoTracks

Gets a read-only list of video tracks in the MediaSource associated with the MediaPlaybackItem.

Methods

ApplyDisplayProperties(MediaItemDisplayProperties) ApplyDisplayProperties(MediaItemDisplayProperties) ApplyDisplayProperties(MediaItemDisplayProperties) ApplyDisplayProperties(MediaItemDisplayProperties) ApplyDisplayProperties(MediaItemDisplayProperties)

Updates the display properties for the MediaPlaybackItem. These properties are used by the System Media Transport Controls to display information about the currently playing media item.

FindFromMediaSource(MediaSource) FindFromMediaSource(MediaSource) FindFromMediaSource(MediaSource) FindFromMediaSource(MediaSource) FindFromMediaSource(MediaSource)

Retrieves the MediaPlaybackItem associated with the provided MediaSource.

GetDisplayProperties() GetDisplayProperties() GetDisplayProperties() GetDisplayProperties() GetDisplayProperties()

Gets the display properties for a MediaPlaybackItem.

Events

AudioTracksChanged AudioTracksChanged AudioTracksChanged AudioTracksChanged AudioTracksChanged

Occurs when the list of audio tracks in the MediaSource associated with the MediaPlaybackItem changes.

TimedMetadataTracksChanged TimedMetadataTracksChanged TimedMetadataTracksChanged TimedMetadataTracksChanged TimedMetadataTracksChanged

Occurs when the list of timed metadata tracks in the MediaSource associated with the MediaPlaybackItem changes.

VideoTracksChanged VideoTracksChanged VideoTracksChanged VideoTracksChanged VideoTracksChanged

Occurs when the list of video tracks in the MediaSource associated with the MediaPlaybackItem changes.

See also