Markers Property

MediaElement.Markers Property

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

Gets the collection of timeline markers associated with the currently loaded media file.

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

public TimelineMarkerCollection Markers { get; }

Property Value

Type: System.Windows.Media.TimelineMarkerCollection
The collection of timeline markers (represented as TimelineMarker objects) associated with the currently loaded media file.
The default value is an empty collection.

This collection is cleared and repopulated each time this MediaElement opens a new source file, and is only considered valid after the MediaOpened event has occurred.

Although the MediaElement object supports all Windows media technology markers (markers, metadata script commands, and separate-stream script commands), this collection does not include any timeline markers encoded as a separate stream in the media file, such as separate-stream script commands. If a file contains both header-embedded script commands and separate-stream script commands, this collection only contains those embedded in the file header. This is because MediaOpened is raised after reading the headers and metadata, but the full source might still be buffering and thus any separate stream markers are not available yet. Separate-stream script commands do trigger the MarkerReached event when encountered during media playback. However these markers are not accessible ahead of time using the Markers property.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

© 2018 Microsoft