PlaylistMediaSource class
Represents a media source that provides playlist functionality for audio and video clips.
Syntax
var playlistMediaSource = new Windows.Media.Playlists.PlaylistMediaSource(playlist);
var playlistMediaSource = new Windows.Media.Playlists.PlaylistMediaSource();
public sealed class PlaylistMediaSource : IMediaSource
Public NotInheritable Class PlaylistMediaSource
Implements IMediaSource
public ref class PlaylistMediaSource sealed : IMediaSource
Attributes
[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version]
Members
The PlaylistMediaSource class has these types of members:
- Constructors
- Events
- Methods
- Properties
Constructors
The PlaylistMediaSource class has these constructors.
Constructor | Description |
---|---|
PlaylistMediaSource | Initializes a new instance of the PlaylistMediaSource class. |
PlaylistMediaSource(Playlist) | Initializes a new instance of the PlaylistMediaSource class using the provided Playlist object to initializes the Clips list. |
Events
The PlaylistMediaSource class has these events.
Event | Description |
---|---|
ClipFailed | Occurs when an error occurs with a media clip in the Clips list. |
ClipResolved | Occurs when a clip in the Clips list is successfully resolved. |
CurrentClipChanged | Occurs when the currently playing media clip changes. |
Methods
The PlaylistMediaSource class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
Method | Description |
---|---|
SwitchToClip | Switches the current media clip to the media clip in the Clips list with the specified index. |
SwitchToNextClip | Switches the current media clip to the next clip in the playlist. |
SwitchToPreviousClip | Switches the current media clip toSwitches the current media clip to the next clip in the playlist. |
Properties
The PlaylistMediaSource class has these properties.
Property | Access type | Description |
---|---|---|
Read-only | Gets the list of media clips in the PlaylistMediaSource. | |
Read-only | Gets the currently playing media clip. | |
Read/write | Gets or sets a value indicating if the playlist should loop after all of the clips have been played. | |
Read/write | Gets or sets a value indicating whether the media clips in the playlist are played in a random order. |
Remarks
Use this class to provide a playlist of media clips to a MediaElement in a XAML-based app by passing an instance of PlaylistMediaSource to the SetMediaStreamSource method.
To use a playlist in a Windows Store app using JavaScript, pass the PlaylistMediaSource object into URL.createObjectURL to retrieve a Blob object that you can use to set the src attribute of an audio or video HTML element.
Requirements
Minimum supported client |
Windows 10 Insider Preview [Windows Store apps, desktop apps] |
Minimum supported server |
Windows Server Technical Preview [Windows Store apps, desktop apps] |
Minimum supported phone |
Windows 10 Mobile Insider Preview |
Namespace |
Windows.Media.Playlists Windows::Media::Playlists [C++] |
Metadata |
Windows.winmd |