MediaPlayer MediaPlayer MediaPlayer MediaPlayer Class

Definition

Provides access to media playback functionality such as play, pause, fast-forward, rewind, and volume.

public : sealed class MediaPlayer : IClosable, IMediaPlayer, IMediaPlayer2, IMediaPlayer3, IMediaPlayer4, IMediaPlayer5, IMediaPlayer6, IMediaPlayerEffects, IMediaPlayerEffects2, IMediaPlayerSource, IMediaPlayerSource2
public sealed class MediaPlayer : IDisposable, IMediaPlayer, IMediaPlayer2, IMediaPlayer3, IMediaPlayer4, IMediaPlayer5, IMediaPlayer6, IMediaPlayerEffects, IMediaPlayerEffects2, IMediaPlayerSource, IMediaPlayerSource2
Public NotInheritable Class MediaPlayer Implements IDisposable, IMediaPlayer, IMediaPlayer2, IMediaPlayer3, IMediaPlayer4, IMediaPlayer5, IMediaPlayer6, IMediaPlayerEffects, IMediaPlayerEffects2, IMediaPlayerSource, IMediaPlayerSource2
var mediaPlayer = new mediaPlayer();
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The Media playback section of the documentation contains how-to articles that provide detailed guidance for adding media playback features to your app. The following table lists some of the available articles.

Topic Description
Play audio and video with MediaPlayer Shows you how to take advantage of the new features and improvements to the media playback system for UWP apps.
Media items, playlists, and tracks Shows you how to use the MediaSource class, which provides a common way to reference and play back media from different sources such as local or remote files and exposes a common model for accessing media data, regardless of the underlying media format.
Integrate with the System Media Transport Controls Shows you how to integrate your app with the System Media Transport Controls (SMTC).
System-supported timed metadata cues Describes how to take advantage of several formats of timed metadata that may be embedded in media files or streams.
Create, schedule, and manage media breaks Shows you how to create, schedule, and manage media breaks to your media playback app.
Play media in the background Shows you how to configure your app so that media continues to play when your app moves from the foreground to the background.
Adaptive Streaming Describes how to add playback of adaptive streaming multimedia content to a Universal Windows Platform (UWP) apps.
Media casting Shows you how to cast media to remote devices from a Universal Windows app.
PlayReady DRM Describes how to add PlayReady protected media content to your Universal Windows Platform (UWP) app.

Media playback SDK samples

The following SDK samples demonstrate the media playback features available to UWP apps on Windows 10. Use these samples to see the media playback APIs used in context or as a starting point for your own app.

Constructors

MediaPlayer() MediaPlayer() MediaPlayer() MediaPlayer()

Initializes a new instance of the MediaPlayer object.

public : MediaPlayer()
public MediaPlayer()
Public Sub New()
var mediaPlayer = new mediaPlayer();
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Properties

AudioBalance AudioBalance AudioBalance AudioBalance

Gets or sets a ratio of volume across stereo speakers.

public : double AudioBalance { get; set; }
public double AudioBalance { get; set; }
Public ReadWrite Property AudioBalance As double
var double = mediaPlayer.audioBalance;
mediaPlayer.audioBalance = double;
Value
double double double double

The ratio of volume across speakers in the range between -1 and 1. The default value is 0.

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

AudioCategory AudioCategory AudioCategory AudioCategory

Gets or sets the type of audio that is currently being played.

public : MediaPlayerAudioCategory AudioCategory { get; set; }
public MediaPlayerAudioCategory AudioCategory { get; set; }
Public ReadWrite Property AudioCategory As MediaPlayerAudioCategory
var mediaPlayerAudioCategory = mediaPlayer.audioCategory;
mediaPlayer.audioCategory = mediaPlayerAudioCategory;

AudioDevice AudioDevice AudioDevice AudioDevice

Gets or sets the DeviceInformation object representing audio device used by the MediaPlayer to render audio.

public : DeviceInformation AudioDevice { get; set; }
public DeviceInformation AudioDevice { get; set; }
Public ReadWrite Property AudioDevice As DeviceInformation
var deviceInformation = mediaPlayer.audioDevice;
mediaPlayer.audioDevice = deviceInformation;
Value
DeviceInformation DeviceInformation DeviceInformation DeviceInformation

The DeviceInformation object representing audio device used by the MediaPlayer to render audio.

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

Remarks

To enumerate the currently available audio devices, call DeviceInformation.FindAllAsync, passing in the device selector string returned from MediaDevice.GetAudioRenderSelector.

AudioDeviceType AudioDeviceType AudioDeviceType AudioDeviceType

Gets or sets a value that describes the primary usage of the device that is being used to play back audio.

public : MediaPlayerAudioDeviceType AudioDeviceType { get; set; }
public MediaPlayerAudioDeviceType AudioDeviceType { get; set; }
Public ReadWrite Property AudioDeviceType As MediaPlayerAudioDeviceType
var mediaPlayerAudioDeviceType = mediaPlayer.audioDeviceType;
mediaPlayer.audioDeviceType = mediaPlayerAudioDeviceType;

AutoPlay AutoPlay AutoPlay AutoPlay

Gets or sets a Boolean value indicating if playback automatically starts after the media is loaded.

public : Platform::Boolean AutoPlay { get; set; }
public bool AutoPlay { get; set; }
Public ReadWrite Property AutoPlay As bool
var bool = mediaPlayer.autoPlay;
mediaPlayer.autoPlay = bool;
Value
Platform::Boolean bool bool bool

True is playback start automatically, otherwise false.

BreakManager BreakManager BreakManager BreakManager

Gets the MediaBreakManager associated with the MediaPlayer, which provides information about and control over media breaks for the player.

public : MediaBreakManager BreakManager { get; }
public MediaBreakManager BreakManager { get; }
Public ReadOnly Property BreakManager As MediaBreakManager
var mediaBreakManager = mediaPlayer.breakManager;
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

BufferingProgress BufferingProgress BufferingProgress BufferingProgress

Gets the amount of buffering that is completed for the media content, expressed as a percentage.

Note

MediaPlayer.BufferingProgress may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the MediaPlaybackSession.BufferingProgress property.

public : double BufferingProgress { get; }
public double BufferingProgress { get; }
Public ReadOnly Property BufferingProgress As double
var double = mediaPlayer.bufferingProgress;
Value
double double double double

The amount of buffering that is completed for the media content.

Remarks

The value ranges from 0 to 1. Multiply by 100 to obtain a percentage. The default value is 0.

CanPause CanPause CanPause CanPause

Gets a Boolean value indicating if the media can be paused.

Note

MediaPlayer.CanPause may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the MediaPlaybackSession.CanPause property.

public : Platform::Boolean CanPause { get; }
public bool CanPause { get; }
Public ReadOnly Property CanPause As bool
var bool = mediaPlayer.canPause;
Value
Platform::Boolean bool bool bool

True if the media can be paused, otherwise false.

CanSeek CanSeek CanSeek CanSeek

Gets a Boolean value indicating if the media supports seeking to a specific position.

Note

MediaPlayer.CanSeek may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the MediaPlaybackSession.CanSeek property.

public : Platform::Boolean CanSeek { get; }
public bool CanSeek { get; }
Public ReadOnly Property CanSeek As bool
var bool = mediaPlayer.canSeek;
Value
Platform::Boolean bool bool bool

True if the media supports seeking, otherwise false.

CommandManager CommandManager CommandManager CommandManager

Gets the MediaPlaybackCommandManager associated with the MediaPlayer, which specifies the behavior of and receives events from the System Media Transport Controls.

public : MediaPlaybackCommandManager CommandManager { get; }
public MediaPlaybackCommandManager CommandManager { get; }
Public ReadOnly Property CommandManager As MediaPlaybackCommandManager
var mediaPlaybackCommandManager = mediaPlayer.commandManager;
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

CurrentState CurrentState CurrentState CurrentState

Gets the current state of media playback.

Note

MediaPlayer.CurrentState may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the MediaPlaybackSession.PlaybackState property.

public : MediaPlayerState CurrentState { get; }
public MediaPlayerState CurrentState { get; }
Public ReadOnly Property CurrentState As MediaPlayerState
var mediaPlayerState = mediaPlayer.currentState;
Value
MediaPlayerState MediaPlayerState MediaPlayerState MediaPlayerState

The current state of media playback.

IsLoopingEnabled IsLoopingEnabled IsLoopingEnabled IsLoopingEnabled

Gets or sets a Boolean value indicating if the media will playback in a repeating loop.

public : Platform::Boolean IsLoopingEnabled { get; set; }
public bool IsLoopingEnabled { get; set; }
Public ReadWrite Property IsLoopingEnabled As bool
var bool = mediaPlayer.isLoopingEnabled;
mediaPlayer.isLoopingEnabled = bool;
Value
Platform::Boolean bool bool bool

True is looping is enabled, otherwise false.

IsMuted IsMuted IsMuted IsMuted

Gets or sets a Boolean value indicating if the audio is muted.

public : Platform::Boolean IsMuted { get; set; }
public bool IsMuted { get; set; }
Public ReadWrite Property IsMuted As bool
var bool = mediaPlayer.isMuted;
mediaPlayer.isMuted = bool;
Value
Platform::Boolean bool bool bool

True if the audio is muted, otherwise false.

IsProtected IsProtected IsProtected IsProtected

Gets a Boolean value indicating if the content is protected by a digital rights management system.

Note

MediaPlayer.IsProtected may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the IsProtected property.

public : Platform::Boolean IsProtected { get; }
public bool IsProtected { get; }
Public ReadOnly Property IsProtected As bool
var bool = mediaPlayer.isProtected;
Value
Platform::Boolean bool bool bool

True if the content is protected, otherwise false.

IsVideoFrameServerEnabled IsVideoFrameServerEnabled IsVideoFrameServerEnabled IsVideoFrameServerEnabled

Gets a value indicating whether video frame server mode is enabled for the MediaPlayer instance.

public : Platform::Boolean IsVideoFrameServerEnabled { get; set; }
public bool IsVideoFrameServerEnabled { get; set; }
Public ReadWrite Property IsVideoFrameServerEnabled As bool
var bool = mediaPlayer.isVideoFrameServerEnabled;
mediaPlayer.isVideoFrameServerEnabled = bool;
Value
Platform::Boolean bool bool bool

True if video frame server mode is enabled; otherwise, false.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

When frame server mode is enabled, the media player does not render video content. Instead, your app should register for the VideoFrameAvailable event and call CopyFrameToVideoSurface when the event is raised to get the video frame data.

NaturalDuration NaturalDuration NaturalDuration NaturalDuration

Get the actual duration of the media without applying the PlaybackRate.

Note

MediaPlayer.NaturalDuration may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the MediaPlaybackSession.NaturalDuration property.

public : TimeSpan NaturalDuration { get; }
public TimeSpan NaturalDuration { get; }
Public ReadOnly Property NaturalDuration As TimeSpan
var timeSpan = mediaPlayer.naturalDuration;
Value
TimeSpan TimeSpan TimeSpan TimeSpan

The actual duration of the media without applying the PlaybackRate.

PlaybackMediaMarkers PlaybackMediaMarkers PlaybackMediaMarkers PlaybackMediaMarkers

Gets the collection of timeline markers for the media.

Note

MediaPlayer.PlaybackMediaMarkers may be altered or unavailable after Windows 10, version 1607. Instead, use MediaPlaybackItem.TimedMetadataTracks to manage data or text cues. For more information, see Media playback with MediaSource.

public : PlaybackMediaMarkerSequence PlaybackMediaMarkers { get; }
public PlaybackMediaMarkerSequence PlaybackMediaMarkers { get; }
Public ReadOnly Property PlaybackMediaMarkers As PlaybackMediaMarkerSequence
var playbackMediaMarkerSequence = mediaPlayer.playbackMediaMarkers;

PlaybackRate PlaybackRate PlaybackRate PlaybackRate

Gets or sets the playback rate, expressed as a percentage.

Note

MediaPlayer.PlaybackRate may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the MediaPlaybackSession.PlaybackRate property.

public : double PlaybackRate { get; set; }
public double PlaybackRate { get; set; }
Public ReadWrite Property PlaybackRate As double
var double = mediaPlayer.playbackRate;
mediaPlayer.playbackRate = double;
Value
double double double double

The playback rate, expressed as a percentage.

Remarks

This value is expressed as a percentage. For example, a value of 1.5 sets the playback rate to 150% of the original.

The playback rate can't be set to a value greater than 1.0 while a MediaPlaybackItem with CanSkip set to false is playing. Attempting to do so will cause an exception to be thrown.

PlaybackSession PlaybackSession PlaybackSession PlaybackSession

Gets the MediaPlaybackSession associated with the MediaPlayer, which provides information about the state of the current playback session and provides events for responding to changes in playback session state.

public : MediaPlaybackSession PlaybackSession { get; }
public MediaPlaybackSession PlaybackSession { get; }
Public ReadOnly Property PlaybackSession As MediaPlaybackSession
var mediaPlaybackSession = mediaPlayer.playbackSession;
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Position Position Position Position

Gets or sets the playback position within the media.

Note

MediaPlayer.Position may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the MediaPlaybackSession.Position property.

public : TimeSpan Position { get; set; }
public TimeSpan Position { get; set; }
Public ReadWrite Property Position As TimeSpan
var timeSpan = mediaPlayer.position;
mediaPlayer.position = timeSpan;
Value
TimeSpan TimeSpan TimeSpan TimeSpan

The playback position within the media.

Remarks

The position can't be moved forward while a MediaPlaybackItem with CanSkip set to false is playing. Attempting to do so will cause an exception to be thrown.

ProtectionManager ProtectionManager ProtectionManager ProtectionManager

Gets or sets the content protection manager for the media.

public : MediaProtectionManager ProtectionManager { get; set; }
public MediaProtectionManager ProtectionManager { get; set; }
Public ReadWrite Property ProtectionManager As MediaProtectionManager
var mediaProtectionManager = mediaPlayer.protectionManager;
mediaPlayer.protectionManager = mediaProtectionManager;

RealTimePlayback RealTimePlayback RealTimePlayback RealTimePlayback

Gets or sets a value that configures the MediaPlayer for real-time scenarios.

public : Platform::Boolean RealTimePlayback { get; set; }
public bool RealTimePlayback { get; set; }
Public ReadWrite Property RealTimePlayback As bool
var bool = mediaPlayer.realTimePlayback;
mediaPlayer.realTimePlayback = bool;
Value
Platform::Boolean bool bool bool

True if the MediaPlayer is being used for real-time media; otherwise, false.

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

Source Source Source Source

Sets the playback source of the media player.

public : IMediaPlaybackSource Source { get; set; }
public IMediaPlaybackSource Source { get; set; }
Public ReadWrite Property Source As IMediaPlaybackSource
var iMediaPlaybackSource = mediaPlayer.source;
mediaPlayer.source = iMediaPlaybackSource;

Remarks

The playback source can be a MediaSource, a MediaPlaybackItem, or a MediaPlaybackList, which is a list of MediaPlaybackItem objects.

StereoscopicVideoRenderMode StereoscopicVideoRenderMode StereoscopicVideoRenderMode StereoscopicVideoRenderMode

Gets or sets a value indicating the current stereoscopic render mode.

public : StereoscopicVideoRenderMode StereoscopicVideoRenderMode { get; set; }
public StereoscopicVideoRenderMode StereoscopicVideoRenderMode { get; set; }
Public ReadWrite Property StereoscopicVideoRenderMode As StereoscopicVideoRenderMode
var stereoscopicVideoRenderMode = mediaPlayer.stereoscopicVideoRenderMode;
mediaPlayer.stereoscopicVideoRenderMode = stereoscopicVideoRenderMode;
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

SystemMediaTransportControls SystemMediaTransportControls SystemMediaTransportControls SystemMediaTransportControls

Gets an instance of the SystemMediaTransportControls class to enable user control of playback of the MediaPlayer and to allow the app to show information about the currently playing content in the system UI.

public : SystemMediaTransportControls SystemMediaTransportControls { get; }
public SystemMediaTransportControls SystemMediaTransportControls { get; }
Public ReadOnly Property SystemMediaTransportControls As SystemMediaTransportControls
var systemMediaTransportControls = mediaPlayer.systemMediaTransportControls;

TimelineController TimelineController TimelineController TimelineController

Gets or sets the MediaTimelineController associated with the MediaPlayer. Use this property to manipulate multiple MediaPlayer instances with a single timeline control.

public : MediaTimelineController TimelineController { get; set; }
public MediaTimelineController TimelineController { get; set; }
Public ReadWrite Property TimelineController As MediaTimelineController
var mediaTimelineController = mediaPlayer.timelineController;
mediaPlayer.timelineController = mediaTimelineController;
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

TimelineControllerPositionOffset TimelineControllerPositionOffset TimelineControllerPositionOffset TimelineControllerPositionOffset

Gets or sets the offset applied to the position of the MediaTimelineController associated with the MediaPlayer.

public : TimeSpan TimelineControllerPositionOffset { get; set; }
public TimeSpan TimelineControllerPositionOffset { get; set; }
Public ReadWrite Property TimelineControllerPositionOffset As TimeSpan
var timeSpan = mediaPlayer.timelineControllerPositionOffset;
mediaPlayer.timelineControllerPositionOffset = timeSpan;
Value
TimeSpan TimeSpan TimeSpan TimeSpan

The offset applied to the position of the MediaTimelineController associated with the MediaPlayer.

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

Remarks

A MediaTimelineController can be associated with multiple instances of MediaPlayer which could be playing different media sources. This property allows you to offset the actual playback position of the player from the current position of the timeline controller.

Volume Volume Volume Volume

Get or sets the audio volume for media playback.

public : double Volume { get; set; }
public double Volume { get; set; }
Public ReadWrite Property Volume As double
var double = mediaPlayer.volume;
mediaPlayer.volume = double;
Value
double double double double

The audio volume for media playback.

Methods

AddAudioEffect(String, Boolean, IPropertySet) AddAudioEffect(String, Boolean, IPropertySet) AddAudioEffect(String, Boolean, IPropertySet) AddAudioEffect(String, Boolean, IPropertySet)

Adds an audio effect to the playback stream of the MediaPlayer.

public : void AddAudioEffect(Platform::String activatableClassId, bool effectOptional, IPropertySet configuration)
public void AddAudioEffect(String activatableClassId, Boolean effectOptional, IPropertySet configuration)
Public Function AddAudioEffect(activatableClassId As String, effectOptional As Boolean, configuration As IPropertySet) As void
mediaPlayer.addAudioEffect(activatableClassId, effectOptional, configuration);
Parameters
activatableClassId
Platform::String String String String

The activatable class ID of the audio effect to add to the playback stream.

effectOptional
bool Boolean Boolean Boolean

A value indicating whether the effect is optional.

configuration
IPropertySet IPropertySet IPropertySet IPropertySet

A property set containing configuration settings for the specified audio effect.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

Remarks

To remove audio effects from the playback stream, call RemoveAllEffects.

AddVideoEffect(String, Boolean, IPropertySet) AddVideoEffect(String, Boolean, IPropertySet) AddVideoEffect(String, Boolean, IPropertySet) AddVideoEffect(String, Boolean, IPropertySet)

Applies a video effect to media playback.

public : void AddVideoEffect(Platform::String activatableClassId, bool effectOptional, IPropertySet effectConfiguration)
public void AddVideoEffect(String activatableClassId, Boolean effectOptional, IPropertySet effectConfiguration)
Public Function AddVideoEffect(activatableClassId As String, effectOptional As Boolean, effectConfiguration As IPropertySet) As void
mediaPlayer.addVideoEffect(activatableClassId, effectOptional, effectConfiguration);
Parameters
activatableClassId
Platform::String String String String

The identifier of the effect.

effectOptional
bool Boolean Boolean Boolean

Tue if the effect shouldn't block playback when the effect can't be used at run time. False if the effect should block playback when the effect can't be used at run time.

effectConfiguration
IPropertySet IPropertySet IPropertySet IPropertySet

A property set that transmits property values to the effect specified by effectID.

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

Close() Close() Close() Close()

Closes the MediaPlayer and disposes of associated resources.

public : void Close()
This member is not implemented in C#
This member is not implemented in VB.Net
mediaPlayer.close();
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

The Close method is used by Universal Windows app using JavaScript. For apps written using the .NET Framework 4.5 in C# and VB.NET, the Close method is exposed as the Dispose() method on the MediaPlayer object. For apps written in C++, the Close method will be called when using the delete keyword on the object.

CopyFrameToStereoscopicVideoSurfaces(IDirect3DSurface, IDirect3DSurface) CopyFrameToStereoscopicVideoSurfaces(IDirect3DSurface, IDirect3DSurface) CopyFrameToStereoscopicVideoSurfaces(IDirect3DSurface, IDirect3DSurface) CopyFrameToStereoscopicVideoSurfaces(IDirect3DSurface, IDirect3DSurface)

Copies the video frame currently displayed by the MediaPlayer to the two provided IDirect3DSurface objects which represent the left eye and right eye content of a stereoscopic video frame.

public : void CopyFrameToStereoscopicVideoSurfaces(IDirect3DSurface destinationLeftEye, IDirect3DSurface destinationRightEye)
public void CopyFrameToStereoscopicVideoSurfaces(IDirect3DSurface destinationLeftEye, IDirect3DSurface destinationRightEye)
Public Function CopyFrameToStereoscopicVideoSurfaces(destinationLeftEye As IDirect3DSurface, destinationRightEye As IDirect3DSurface) As void
mediaPlayer.copyFrameToStereoscopicVideoSurfaces(destinationLeftEye, destinationRightEye);
Parameters
destinationLeftEye
IDirect3DSurface IDirect3DSurface IDirect3DSurface IDirect3DSurface

The surface to which the left eye content is copied.

destinationRightEye
IDirect3DSurface IDirect3DSurface IDirect3DSurface IDirect3DSurface

The surface to which the right eye content is copied.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

CopyFrameToVideoSurface(IDirect3DSurface) CopyFrameToVideoSurface(IDirect3DSurface) CopyFrameToVideoSurface(IDirect3DSurface) CopyFrameToVideoSurface(IDirect3DSurface)

Copies the current video frame from the MediaPlayer to the provided IDirect3DSurface.

public : void CopyFrameToVideoSurface(IDirect3DSurface destination)
public void CopyFrameToVideoSurface(IDirect3DSurface destination)
Public Function CopyFrameToVideoSurface(destination As IDirect3DSurface) As void
mediaPlayer.copyFrameToVideoSurface(destination);
Parameters
destination
IDirect3DSurface IDirect3DSurface IDirect3DSurface IDirect3DSurface

The IDirect3DSurface to which the video frame is copied.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

CopyFrameToVideoSurface(IDirect3DSurface, Rect) CopyFrameToVideoSurface(IDirect3DSurface, Rect) CopyFrameToVideoSurface(IDirect3DSurface, Rect) CopyFrameToVideoSurface(IDirect3DSurface, Rect)

Copies the current video frame from the MediaPlayer to the specified target rectangle within the provided IDirect3DSurface.

public : void CopyFrameToVideoSurface(IDirect3DSurface destination, Rect targetRectangle)
public void CopyFrameToVideoSurface(IDirect3DSurface destination, Rect targetRectangle)
Public Function CopyFrameToVideoSurface(destination As IDirect3DSurface, targetRectangle As Rect) As void
mediaPlayer.copyFrameToVideoSurface(destination, targetRectangle);
Parameters
destination
IDirect3DSurface IDirect3DSurface IDirect3DSurface IDirect3DSurface

The IDirect3DSurface to which the video frame is copied.

targetRectangle
Rect Rect Rect Rect

The target rectangle within the IDirect3DSurface to which the video frame is copied.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

This member is not implemented in C++
void Dispose()
Sub Dispose
void Dispose()

GetAsCastingSource() GetAsCastingSource() GetAsCastingSource() GetAsCastingSource()

Gets a CastingSource representing the MediaPlayer, which allows it's media to be cast to other devices.

public : CastingSource GetAsCastingSource()
public CastingSource GetAsCastingSource()
Public Function GetAsCastingSource() As CastingSource
var castingSource = mediaPlayer.getAsCastingSource();
Returns
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

For more information on casting media to remote devices, see Media casting.

GetSurface(Compositor) GetSurface(Compositor) GetSurface(Compositor) GetSurface(Compositor)

Gets a MediaPlayerSurface object for the MediaPlayer, which allows you to render the player's contents using a Compositor without relying on the XAML framework.

public : MediaPlayerSurface GetSurface(Compositor compositor)
public MediaPlayerSurface GetSurface(Compositor compositor)
Public Function GetSurface(compositor As Compositor) As MediaPlayerSurface
var mediaPlayerSurface = mediaPlayer.getSurface(compositor);
Parameters
compositor
Compositor Compositor Compositor Compositor

The Compositor with which the returned surface will be used.

Returns
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

By default, the CompositionSurface generated by this method will have the dimensions 640x 480, in pixels. To get a different size, call SetSurfaceSize before calling GetSurface.

You can obtain multiple surfaces from a single MediaPlayer instance by calling MediaPlayer multiple times.

For more information on using the Windows.UI.Composition APIs to render visuals, see Visual layer.

For how-to guidance for rendering video to a composition surface, see Play audio and video with MediaPlayer.

See Also

Pause() Pause() Pause() Pause()

Pauses media playback.

public : void Pause()
public void Pause()
Public Function Pause() As void
mediaPlayer.pause();

Remarks

Note that after you call Pause, the time represented by the Position property may not be precisely accurate. Apps that need a frame-accurate position value, such as media editors, should call MediaPlayer.StepForwardOneFrame immediately after calling Pause before reading the Position value.

Play() Play() Play() Play()

Starts media playback.

public : void Play()
public void Play()
Public Function Play() As void
mediaPlayer.play();

RemoveAllEffects() RemoveAllEffects() RemoveAllEffects() RemoveAllEffects()

Removes all effects from the playback stream of the MediaPlayer.

public : void RemoveAllEffects()
public void RemoveAllEffects()
Public Function RemoveAllEffects() As void
mediaPlayer.removeAllEffects();
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

Remarks

Add effects to the playback stream by calling AddAudioEffect or AddVideoEffect.

RenderSubtitlesToSurface(IDirect3DSurface) RenderSubtitlesToSurface(IDirect3DSurface) RenderSubtitlesToSurface(IDirect3DSurface) RenderSubtitlesToSurface(IDirect3DSurface)

Requests for the system to render the current subtitle text to the provided IDirect3DSurface.

public : Platform::Boolean RenderSubtitlesToSurface(IDirect3DSurface destination)
public bool RenderSubtitlesToSurface(IDirect3DSurface destination)
Public Function RenderSubtitlesToSurface(destination As IDirect3DSurface) As bool
var bool = mediaPlayer.renderSubtitlesToSurface(destination);
Parameters
destination
IDirect3DSurface IDirect3DSurface IDirect3DSurface IDirect3DSurface

The object that implements IDirect3DSurface to which the subtitle text is rendered.

Returns
Platform::Boolean bool bool bool

True if the system rendered subtitles to the surface; otherwise false.

Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

Handle the SubtitleFrameChanged event to receive a notification that the subtitle content has changed. Check the return value to see if subtitles were rendered. If the method returns false, then no subtitles were rendered. In this case you may decide to hide the subtitle render surface in your UI.

In order to use this feature, you must place the MediaPlayer into frame server mode by setting IsVideoFrameServerEnabled to true, and the playing media content must have at least one timed metadata track that has had its presentation mode set to PlatformPresented with a call to Media​Playback​Timed​Metadata​Track​List.SetPresentationMode. For more information on using MediaPlayer in frame server mode, see Play audio and video with MediaPlayer. For more information on working with metadata tracks, see Media items, playlists, and tracks.

RenderSubtitlesToSurface(IDirect3DSurface, Rect) RenderSubtitlesToSurface(IDirect3DSurface, Rect) RenderSubtitlesToSurface(IDirect3DSurface, Rect) RenderSubtitlesToSurface(IDirect3DSurface, Rect)

Requests for the system to render the current subtitle text to the specified target rectangle within the provided IDirect3DSurface.

public : Platform::Boolean RenderSubtitlesToSurface(IDirect3DSurface destination, Rect targetRectangle)
public bool RenderSubtitlesToSurface(IDirect3DSurface destination, Rect targetRectangle)
Public Function RenderSubtitlesToSurface(destination As IDirect3DSurface, targetRectangle As Rect) As bool
var bool = mediaPlayer.renderSubtitlesToSurface(destination, targetRectangle);
Parameters
destination
IDirect3DSurface IDirect3DSurface IDirect3DSurface IDirect3DSurface

The object that implements IDirect3DSurface to which the subtitle text is rendered.

targetRectangle
Rect Rect Rect Rect

The rectangle within the provided surface within which the subtitles are rendered.

Returns
Platform::Boolean bool bool bool

True if the system rendered subtitles to the surface; otherwise false.

Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

Note that this method is less efficient than the other overload of RenderSubtitleToSurface, but it allows you to use the same surface for rendering video and subtitles rather than requiring a separate surface for subtitles.

Handle the SubtitleFrameChanged event to receive a notification that the subtitle content has changed. Check the return value to see if subtitles were rendered.

In order to use this feature, you must place the MediaPlayer into frame server mode by setting IsVideoFrameServerEnabled to true, and the playing media content must have at least one timed metadata track that has had its presentation mode set to PlatformPresented with a call to Media​Playback​Timed​Metadata​Track​List.SetPresentationMode. For more information on using MediaPlayer in frame server mode, see Play audio and video with MediaPlayer. For more information on working with metadata tracks, see Media items, playlists, and tracks.

SetFileSource(IStorageFile) SetFileSource(IStorageFile) SetFileSource(IStorageFile) SetFileSource(IStorageFile)

Set the media source to a file.

Note

MediaPlayer.SetFileSource may be altered or unavailable after Windows 10. Use MediaPlayer.Source instead.

public : void SetFileSource(IStorageFile file)
public void SetFileSource(IStorageFile file)
Public Function SetFileSource(file As IStorageFile) As void
mediaPlayer.setFileSource(file);
Parameters
file
IStorageFile IStorageFile IStorageFile IStorageFile

The media source file.

SetMediaSource(IMediaSource) SetMediaSource(IMediaSource) SetMediaSource(IMediaSource) SetMediaSource(IMediaSource)

Sets the media source for playback.

Note

MediaPlayer.SetMediaSource may be altered or unavailable after Windows 10. Use MediaPlayer.Source instead.

public : void SetMediaSource(IMediaSource source)
public void SetMediaSource(IMediaSource source)
Public Function SetMediaSource(source As IMediaSource) As void
mediaPlayer.setMediaSource(source);
Parameters
source
IMediaSource IMediaSource IMediaSource IMediaSource

The media source for playback.

SetStreamSource(IRandomAccessStream) SetStreamSource(IRandomAccessStream) SetStreamSource(IRandomAccessStream) SetStreamSource(IRandomAccessStream)

Sets the media source to a stream.

Note

MediaPlayer.SetMediaSource may be altered or unavailable after Windows 10. Use MediaPlayer.Source instead.

public : void SetStreamSource(IRandomAccessStream stream)
public void SetStreamSource(IRandomAccessStream stream)
Public Function SetStreamSource(stream As IRandomAccessStream) As void
mediaPlayer.setStreamSource(stream);
Parameters

SetSurfaceSize(Size) SetSurfaceSize(Size) SetSurfaceSize(Size) SetSurfaceSize(Size)

Sets the size of the composition surface returned by GetSurface.

public : void SetSurfaceSize(Size size)
public void SetSurfaceSize(Size size)
Public Function SetSurfaceSize(size As Size) As void
mediaPlayer.setSurfaceSize(size);
Parameters
size
Size Size Size Size

An object representing the size of the composition surface.

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

Remarks

The default size for the composition surface returned by GetSurface is 640x480, in pixels.

SetUriSource(Uri) SetUriSource(Uri) SetUriSource(Uri) SetUriSource(Uri)

Sets the path to the media.

Note

MediaPlayer.SetUriSource may be altered or unavailable after Windows 10. Use MediaPlayer.Source instead.

public : void SetUriSource(Uri value)
public void SetUriSource(Uri value)
Public Function SetUriSource(value As Uri) As void
mediaPlayer.setUriSource(value);
Parameters
value
Uri Uri Uri Uri

The path to the media.

StepBackwardOneFrame() StepBackwardOneFrame() StepBackwardOneFrame() StepBackwardOneFrame()

Causes the playback position of the MediaPlayer to move backward by .042 seconds, which corresponds to one frame at 24 fps, regardless of the actual frame rate of the content being played.

public : void StepBackwardOneFrame()
public void StepBackwardOneFrame()
Public Function StepBackwardOneFrame() As void
mediaPlayer.stepBackwardOneFrame();
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

StepForwardOneFrame() StepForwardOneFrame() StepForwardOneFrame() StepForwardOneFrame()

Causes the MediaPlayer to move forward in the current media by one frame.

public : void StepForwardOneFrame()
public void StepForwardOneFrame()
Public Function StepForwardOneFrame() As void
mediaPlayer.stepForwardOneFrame();
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Events

BufferingEnded BufferingEnded BufferingEnded BufferingEnded

Occurs when buffering has finished.

Note

MediaPlayer.BufferingEnded may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the MediaPlaybackSession.BufferingEnded event.

public : event TypedEventHandler BufferingEnded<MediaPlayer, object>
public event TypedEventHandler BufferingEnded<MediaPlayer, object>
Public Event TypedEventHandler BufferingEnded( Of ( Of MediaPlayer ), ( Of object ))
function onBufferingEnded(eventArgs){/* Your code */}


mediaPlayer.addEventListener("bufferingEnded", onBufferingEnded);
mediaPlayer.removeEventListener("bufferingEnded", onBufferingEnded);

BufferingStarted BufferingStarted BufferingStarted BufferingStarted

Occurs when buffering has started.

Note

MediaPlayer.BufferingStarted may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the MediaPlaybackSession.BufferingStarted event.

public : event TypedEventHandler BufferingStarted<MediaPlayer, object>
public event TypedEventHandler BufferingStarted<MediaPlayer, object>
Public Event TypedEventHandler BufferingStarted( Of ( Of MediaPlayer ), ( Of object ))
function onBufferingStarted(eventArgs){/* Your code */}


mediaPlayer.addEventListener("bufferingStarted", onBufferingStarted);
mediaPlayer.removeEventListener("bufferingStarted", onBufferingStarted);

CurrentStateChanged CurrentStateChanged CurrentStateChanged CurrentStateChanged

Occurs when the state of the media player has changed.

Note

MediaPlayer.CurrentStateChanged may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the MediaPlaybackSession.PlaybackStateChanged event.

public : event TypedEventHandler CurrentStateChanged<MediaPlayer, object>
public event TypedEventHandler CurrentStateChanged<MediaPlayer, object>
Public Event TypedEventHandler CurrentStateChanged( Of ( Of MediaPlayer ), ( Of object ))
function onCurrentStateChanged(eventArgs){/* Your code */}


mediaPlayer.addEventListener("currentStateChanged", onCurrentStateChanged);
mediaPlayer.removeEventListener("currentStateChanged", onCurrentStateChanged);

IsMutedChanged IsMutedChanged IsMutedChanged IsMutedChanged

Occurs when the current muted status of the MediaPlayer changes.

public : event TypedEventHandler IsMutedChanged<MediaPlayer, object>
public event TypedEventHandler IsMutedChanged<MediaPlayer, object>
Public Event TypedEventHandler IsMutedChanged( Of ( Of MediaPlayer ), ( Of object ))
function onIsMutedChanged(eventArgs){/* Your code */}


mediaPlayer.addEventListener("isMutedChanged", onIsMutedChanged);
mediaPlayer.removeEventListener("isMutedChanged", onIsMutedChanged);
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

MediaEnded MediaEnded MediaEnded MediaEnded

Occurs when the media has finished playback.

public : event TypedEventHandler MediaEnded<MediaPlayer, object>
public event TypedEventHandler MediaEnded<MediaPlayer, object>
Public Event TypedEventHandler MediaEnded( Of ( Of MediaPlayer ), ( Of object ))
function onMediaEnded(eventArgs){/* Your code */}


mediaPlayer.addEventListener("mediaEnded", onMediaEnded);
mediaPlayer.removeEventListener("mediaEnded", onMediaEnded);

MediaFailed MediaFailed MediaFailed MediaFailed

Occurs when an error is encountered.

public : event TypedEventHandler MediaFailed<MediaPlayer, MediaPlayerFailedEventArgs>
public event TypedEventHandler MediaFailed<MediaPlayer, MediaPlayerFailedEventArgs>
Public Event TypedEventHandler MediaFailed( Of ( Of MediaPlayer ), ( Of MediaPlayerFailedEventArgs ))
function onMediaFailed(eventArgs){/* Your code */}


mediaPlayer.addEventListener("mediaFailed", onMediaFailed);
mediaPlayer.removeEventListener("mediaFailed", onMediaFailed);

MediaOpened MediaOpened MediaOpened MediaOpened

Occurs when the media is opened.

public : event TypedEventHandler MediaOpened<MediaPlayer, object>
public event TypedEventHandler MediaOpened<MediaPlayer, object>
Public Event TypedEventHandler MediaOpened( Of ( Of MediaPlayer ), ( Of object ))
function onMediaOpened(eventArgs){/* Your code */}


mediaPlayer.addEventListener("mediaOpened", onMediaOpened);
mediaPlayer.removeEventListener("mediaOpened", onMediaOpened);

MediaPlayerRateChanged MediaPlayerRateChanged MediaPlayerRateChanged MediaPlayerRateChanged

Occurs when the media playback rate has changed.

Note

MediaPlayer.MediaPlayerRateChanged may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the MediaPlaybackSession.PlaybackRateChanged event.

public : event TypedEventHandler MediaPlayerRateChanged<MediaPlayer, MediaPlayerRateChangedEventArgs>
public event TypedEventHandler MediaPlayerRateChanged<MediaPlayer, MediaPlayerRateChangedEventArgs>
Public Event TypedEventHandler MediaPlayerRateChanged( Of ( Of MediaPlayer ), ( Of MediaPlayerRateChangedEventArgs ))
function onMediaPlayerRateChanged(eventArgs){/* Your code */}


mediaPlayer.addEventListener("mediaPlayerRateChanged", onMediaPlayerRateChanged);
mediaPlayer.removeEventListener("mediaPlayerRateChanged", onMediaPlayerRateChanged);

PlaybackMediaMarkerReached PlaybackMediaMarkerReached PlaybackMediaMarkerReached PlaybackMediaMarkerReached

Occurs when a media marker has been reached during playback.

Note

MediaPlayer.PlaybackMediaMarkerReached may be altered or unavailable after Windows 10, version 1607. Instead, use MediaPlaybackItem.TimedMetadataTracks to manage data or text cues. For more information, see Media playback with MediaSource.

public : event TypedEventHandler PlaybackMediaMarkerReached<MediaPlayer, PlaybackMediaMarkerReachedEventArgs>
public event TypedEventHandler PlaybackMediaMarkerReached<MediaPlayer, PlaybackMediaMarkerReachedEventArgs>
Public Event TypedEventHandler PlaybackMediaMarkerReached( Of ( Of MediaPlayer ), ( Of PlaybackMediaMarkerReachedEventArgs ))
function onPlaybackMediaMarkerReached(eventArgs){/* Your code */}


mediaPlayer.addEventListener("playbackMediaMarkerReached", onPlaybackMediaMarkerReached);
mediaPlayer.removeEventListener("playbackMediaMarkerReached", onPlaybackMediaMarkerReached);

SeekCompleted SeekCompleted SeekCompleted SeekCompleted

Occurs when a seek operation has finished.

Note

MediaPlayer.SeekCompleted may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the MediaPlaybackSession.SeekCompleted event.

public : event TypedEventHandler SeekCompleted<MediaPlayer, object>
public event TypedEventHandler SeekCompleted<MediaPlayer, object>
Public Event TypedEventHandler SeekCompleted( Of ( Of MediaPlayer ), ( Of object ))
function onSeekCompleted(eventArgs){/* Your code */}


mediaPlayer.addEventListener("seekCompleted", onSeekCompleted);
mediaPlayer.removeEventListener("seekCompleted", onSeekCompleted);

SourceChanged SourceChanged SourceChanged SourceChanged

Occurs when the media source for the MediaPlayer changes.

public : event TypedEventHandler SourceChanged<MediaPlayer, object>
public event TypedEventHandler SourceChanged<MediaPlayer, object>
Public Event TypedEventHandler SourceChanged( Of ( Of MediaPlayer ), ( Of object ))
function onSourceChanged(eventArgs){/* Your code */}


mediaPlayer.addEventListener("sourceChanged", onSourceChanged);
mediaPlayer.removeEventListener("sourceChanged", onSourceChanged);
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

A typical use of this event is if you are implementing your own transport controls. You can respond to this event by checking to see whether the source is a MediaSource, MediaPlaybackItem, or MediaPlaybackList and then update your UI accordingly. For example, if the source is a MediaPlaybackItem, you could subscribe to the list of audio and caption tracks and update the list in your UI so that the user can select the active track.

SubtitleFrameChanged SubtitleFrameChanged SubtitleFrameChanged SubtitleFrameChanged

Occurs when the current subtitle content has changed while the MediaPlayer is in frame server mode.

public : event TypedEventHandler SubtitleFrameChanged<MediaPlayer, object>
public event TypedEventHandler SubtitleFrameChanged<MediaPlayer, object>
Public Event TypedEventHandler SubtitleFrameChanged( Of ( Of MediaPlayer ), ( Of object ))
function onSubtitleFrameChanged(eventArgs){/* Your code */}


mediaPlayer.addEventListener("subtitleFrameChanged", onSubtitleFrameChanged);
mediaPlayer.removeEventListener("subtitleFrameChanged", onSubtitleFrameChanged);
Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

In the handler for this event, you can call one of the overloads of RenderSubtitlesToSurface to request that the system render the current subtitles to the provided IDirect3DSurface. If this method returns false, then no subtitles were rendered. In this case, you may choose to hide the subtitle render surface until the next time the event is raised.

In order for this event to be raised, you must place the MediaPlayer into frame server mode by setting IsVideoFrameServerEnabled to true, and the playing media content must have at least one timed metadata track that has had its presentation mode set to PlatformPresented with a call to Media​Playback​Timed​Metadata​Track​List.SetPresentationMode. For more information on using MediaPlayer in frame server mode, see Play audio and video with MediaPlayer. For more information on working with metadata tracks, see Media items, playlists, and tracks.

VideoFrameAvailable VideoFrameAvailable VideoFrameAvailable VideoFrameAvailable

Occurs when IsVideoFrameServerEnabled is set to true and a new video frame is available for processing.

public : event TypedEventHandler VideoFrameAvailable<MediaPlayer, object>
public event TypedEventHandler VideoFrameAvailable<MediaPlayer, object>
Public Event TypedEventHandler VideoFrameAvailable( Of ( Of MediaPlayer ), ( Of object ))
function onVideoFrameAvailable(eventArgs){/* Your code */}


mediaPlayer.addEventListener("videoFrameAvailable", onVideoFrameAvailable);
mediaPlayer.removeEventListener("videoFrameAvailable", onVideoFrameAvailable);
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

In the handler for this event, call CopyFrameToVideoSurface to get the video frame data.

VolumeChanged VolumeChanged VolumeChanged VolumeChanged

Occurs when the volume of the audio has changed.

public : event TypedEventHandler VolumeChanged<MediaPlayer, object>
public event TypedEventHandler VolumeChanged<MediaPlayer, object>
Public Event TypedEventHandler VolumeChanged( Of ( Of MediaPlayer ), ( Of object ))
function onVolumeChanged(eventArgs){/* Your code */}


mediaPlayer.addEventListener("volumeChanged", onVolumeChanged);
mediaPlayer.removeEventListener("volumeChanged", onVolumeChanged);