SeekAsync Method

MediaStreamSource.SeekAsync Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

The MediaElement calls this method to ask the MediaStreamSource to seek to the nearest randomly accessible point before the specified time. Developers respond to this method by calling ReportSeekCompleted and by ensuring future calls to ReportGetSampleCompleted will return samples from that point in the media.

Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)

protected abstract void SeekAsync(
	long seekToTime


Type: System.Int64
The time as represented by 100 nanosecond increments to seek to. This is typically measured from the beginning of the media file.

If the MediaElement was opened with MediaSourceAttributesKeys.CanSeek attribute equal to Boolean.FalseString, then SeekAsync will only be called with the seekToTime value equal to zero. The MediaElement also ensures seekToTime is less than or equal to the duration reported in ReportOpenMediaCompleted.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2018 Microsoft