This topic has not yet been rated - Rate this topic

MediaElement.CanSeek Property

April 12, 2014

Gets a value indicating if media can be repositioned by setting the value of the Position property.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
public bool CanSeek { get; }

Property Value

Type: System.Boolean
true if the media can be repositioned; otherwise, false.
The default value is false.

Dependency property identifier field: CanSeekProperty

Live streaming media cannot be paused. Therefore CanSeek returns false for any case where the MediaElement has loaded live streaming media. However, it should not be inferred that any case where CanSeek is false always indicates streaming media. This API is intended for determining whether user capabilities are available at a point in time so that your application can present appropriate UI, and is not intended for probing the media itself.

Setting Position on a MediaElement that has opened and is playing streaming content does not throw an error. Instead the method call is ignored.

One scenario for this property is to check it after MediaOpened is raised, and potentially change the display characteristics of any "Scrub" control appears in UI if CanSeek is false.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft. All rights reserved.