MediaPlaybackSession MediaPlaybackSession MediaPlaybackSession MediaPlaybackSession MediaPlaybackSession Class

Definition

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

public : sealed class MediaPlaybackSession
struct winrt::Windows::Media::Playback::MediaPlaybackSession
public sealed class MediaPlaybackSession
Public NotInheritable Class MediaPlaybackSession
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

Get an instance of this class by accessing the PlaybackSession property of a MediaPlayer or the PlaybackSession property of a MediaBreakManager.

For how-to guidance for working with MediaPlayer and playback sessions, see Play audio and video with MediaPlayer.

Properties

BufferingProgress BufferingProgress BufferingProgress BufferingProgress BufferingProgress

Gets a value that indicates the current buffering progress of a MediaPlaybackSession.

CanPause CanPause CanPause CanPause CanPause

Gets a value that indicates whether media can be paused if the MediaPlayer.Pause method is called.

CanSeek CanSeek CanSeek CanSeek CanSeek

Gets a value that indicates whether the current playback position of the media can be changed by setting the value of the MediaPlayer.Position property.

DownloadProgress DownloadProgress DownloadProgress DownloadProgress DownloadProgress

Gets a value indicating the position after the current playback Position to which downloading has completed and content is buffered.

IsMirroring IsMirroring IsMirroring IsMirroring IsMirroring

Gets or sets a value indicating whether the content of the media playback session is currently being mirrored horizontally.

IsProtected IsProtected IsProtected IsProtected IsProtected

Gets a value that indicates whether the media that is currently playing in the MediaPlaybackSession is protected by digital rights management (DRM).

MediaPlayer MediaPlayer MediaPlayer MediaPlayer MediaPlayer

Gets the MediaPlayer associated with the MediaPlaybackSession.

NaturalDuration NaturalDuration NaturalDuration NaturalDuration NaturalDuration

Gets a value indicating the duration of the currently playing media, when being played back at normal speed.

NaturalVideoHeight NaturalVideoHeight NaturalVideoHeight NaturalVideoHeight NaturalVideoHeight

Gets the height of the video in the currently playing media item.

NaturalVideoWidth NaturalVideoWidth NaturalVideoWidth NaturalVideoWidth NaturalVideoWidth

Gets the width of the video in the currently playing media item.

NormalizedSourceRect NormalizedSourceRect NormalizedSourceRect NormalizedSourceRect NormalizedSourceRect

Gets or sets a normalized rectangle within the video source which is rendered by the MediaPlayer. This enables pan and zoom within video.

PlaybackRate PlaybackRate PlaybackRate PlaybackRate PlaybackRate

Gets or sets a value representing the current playback rate for the MediaPlaybackSession.

PlaybackRotation PlaybackRotation PlaybackRotation PlaybackRotation PlaybackRotation

Gets or sets a value from the MediaRotation enumeration that specifies the rotation applied to video content during playback.

PlaybackState PlaybackState PlaybackState PlaybackState PlaybackState

Gets a value indicating the current playback state of the MediaPlaybackSession, such as buffering or playing.

Position Position Position Position Position

Gets or sets the current playback position within the currently playing media.

SphericalVideoProjection SphericalVideoProjection SphericalVideoProjection SphericalVideoProjection SphericalVideoProjection

Gets an object that manages the spherical video projection settings used by the media playback session.

StereoscopicVideoPackingMode StereoscopicVideoPackingMode StereoscopicVideoPackingMode StereoscopicVideoPackingMode StereoscopicVideoPackingMode

Gets or sets a value specifying the stereoscopic video packing mode for the MediaPlaybackSession.

Methods

GetBufferedRanges() GetBufferedRanges() GetBufferedRanges() GetBufferedRanges() GetBufferedRanges()

Retrieves a read-only list of time ranges for which data is buffered and playback can begin immediately.

GetOutputDegradationPolicyState() GetOutputDegradationPolicyState() GetOutputDegradationPolicyState() GetOutputDegradationPolicyState() GetOutputDegradationPolicyState()

Gets an object that expresses the current output degradation policy state of the MediaPlaybackSession.

GetPlayedRanges() GetPlayedRanges() GetPlayedRanges() GetPlayedRanges() GetPlayedRanges()

Retrieves a read-only list of time ranges for which content has been played back.

GetSeekableRanges() GetSeekableRanges() GetSeekableRanges() GetSeekableRanges() GetSeekableRanges()

Retrieves a read-only list of time ranges in which the playack position can be seeked to. For live streaming, these ranges represent the times ranges for which data is still available.

IsSupportedPlaybackRateRange(Double, Double) IsSupportedPlaybackRateRange(Double, Double) IsSupportedPlaybackRateRange(Double, Double) IsSupportedPlaybackRateRange(Double, Double) IsSupportedPlaybackRateRange(Double, Double)

Gets a value indicating whether the specified range of playback rates is supported.

Events

BufferedRangesChanged BufferedRangesChanged BufferedRangesChanged BufferedRangesChanged BufferedRangesChanged

Occurs when the set of time ranges for which data is buffered changes.

BufferingEnded BufferingEnded BufferingEnded BufferingEnded BufferingEnded

Occurs when buffering ends for the MediaPlaybackSession.

BufferingProgressChanged BufferingProgressChanged BufferingProgressChanged BufferingProgressChanged BufferingProgressChanged

Occurs when the buffering progress for the MediaPlaybackSession changes.

BufferingStarted BufferingStarted BufferingStarted BufferingStarted BufferingStarted

Occurs when buffering starts for the MediaPlaybackSession.

DownloadProgressChanged DownloadProgressChanged DownloadProgressChanged DownloadProgressChanged DownloadProgressChanged

Occurs when the download progress for a MediaPlaybackSession changes.

NaturalDurationChanged NaturalDurationChanged NaturalDurationChanged NaturalDurationChanged NaturalDurationChanged

Occurs when the duration of the currently playing media item changes.

NaturalVideoSizeChanged NaturalVideoSizeChanged NaturalVideoSizeChanged NaturalVideoSizeChanged NaturalVideoSizeChanged

Occurs when the size of the video in the currently playing media item changes.

PlaybackRateChanged PlaybackRateChanged PlaybackRateChanged PlaybackRateChanged PlaybackRateChanged

Occurs when the current playback rate for the MediaPlaybackSession changes.

PlaybackStateChanged PlaybackStateChanged PlaybackStateChanged PlaybackStateChanged PlaybackStateChanged

Occurs when the current playback state changes.

PlayedRangesChanged PlayedRangesChanged PlayedRangesChanged PlayedRangesChanged PlayedRangesChanged

Occurs when the set of time ranges that have been played changes.

PositionChanged PositionChanged PositionChanged PositionChanged PositionChanged

Occurs when the current playback position within the currently playing media changes.

SeekableRangesChanged SeekableRangesChanged SeekableRangesChanged SeekableRangesChanged SeekableRangesChanged

Occurs when the set of time ranges that can be seeked to changes.

SeekCompleted SeekCompleted SeekCompleted SeekCompleted SeekCompleted

Occurs when a seek operation for the MediaPlaybackSession completes.

SupportedPlaybackRatesChanged SupportedPlaybackRatesChanged SupportedPlaybackRatesChanged SupportedPlaybackRatesChanged SupportedPlaybackRatesChanged

Occurs when the set of playback rates supported by the media playback session changes.

See also