共用方式為


MediaStreamSource.SeekAsync Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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)

Syntax

'Declaration
Protected MustOverride Sub SeekAsync ( _
    seekToTime As Long _
)
protected abstract void SeekAsync(
    long seekToTime
)

Parameters

  • 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.

Remarks

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.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.