Expand Minimize

MediaElement.Play method

Applies to Windows and Windows Phone

Plays media from the current position.

Syntax


Public Sub Play()

Parameters

This method has no parameters.

Remarks

To enable full-screen video playback you must set the Width and Height of the MediaElement to the Window.Bounds of the current window. Specifically, use Window.Current.Bounds.Width and Window.Current.Bounds.Height. Full screen playback will not take advantage of system optimizations if you set the dimensions of a parent element, such as a grid, or a containing element instead of the MediaElement.

To prevent the display from being deactivated when user action is no longer detected, such as when an app is playing full-screen video, you can call DisplayRequest.RequestActive. To conserve power and battery life, you should call DisplayRequest.RequestRelease to release the display request when it is no longer required. See the Display power state sample for more info.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

MediaElement

 

 

Show:
© 2014 Microsoft