TimelineMarker Class
Definition
Represents metadata associated with a specific point in a media file.
Equivalent WinUI class: Microsoft.UI.Xaml.Media.TimelineMarker.
public ref class TimelineMarker sealed : DependencyObject
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Media.ITimelineMarkerStatics, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
class TimelineMarker sealed : DependencyObject
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Media.ITimelineMarkerStatics, 65536, "Windows.Foundation.UniversalApiContract")]
class TimelineMarker sealed : DependencyObject
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Media.ITimelineMarkerStatics), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
public sealed class TimelineMarker : DependencyObject
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Media.ITimelineMarkerStatics), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class TimelineMarker : DependencyObject
Public NotInheritable Class TimelineMarker
Inherits DependencyObject
- Inheritance
- Attributes
Windows 10 requirements
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
Examples
The following example creates a MediaElement object and responds to its MarkerReached event. Each time a timeline marker is reached, the example displays the timeline marker's Time, Type, and Text values.
<MediaElement Name="Media" Source="video.mp4" MarkerReached="Media_MarkerReached" />
<TextBlock Name="txOutput" />
private void Media_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e)
{
txOutput.Text =
string.Format("{0},{1},{2}", e.Marker.Time, e.Marker.Text, e.Marker.Type);
}
Remarks
A timeline marker is metadata associated with a particular point in a media file. These markers are usually created ahead of time and stored in the media file itself. They are typically used to name different scenes in a video or provide scripting cues. By handling the MediaElement object's MarkerReached event or by accessing the MediaElement object's Markers property, you can use timeline markers to trigger actions or enable users to seek to selected positions in the media file.
Constructors
TimelineMarker() |
Initializes a new instance of the TimelineMarker class. Equivalent WinUI constructor: Microsoft.UI.Xaml.Media.TimelineMarker.TimelineMarker. |
Properties
Dispatcher |
Gets the CoreDispatcher that this object is associated with. The CoreDispatcher represents a facility that can access the DependencyObject on the UI thread even if the code is initiated by a non-UI thread. Equivalent WinUI property: Microsoft.UI.Xaml.DependencyObject.Dispatcher. (Inherited from DependencyObject) |
Text |
Gets or sets the text value of a TimelineMarker. Equivalent WinUI property: Microsoft.UI.Xaml.Media.TimelineMarker.Text. |
TextProperty |
Identifies the Text dependency property. Equivalent WinUI property: Microsoft.UI.Xaml.Media.TimelineMarker.TextProperty. |
Time |
Gets or sets the time at which a TimelineMarker is reached. Equivalent WinUI property: Microsoft.UI.Xaml.Media.TimelineMarker.Time. |
TimeProperty |
Identifies the Time dependency property. Equivalent WinUI property: Microsoft.UI.Xaml.Media.TimelineMarker.TimeProperty. |
Type |
Gets or sets the marker type of a TimelineMarker. Equivalent WinUI property: Microsoft.UI.Xaml.Media.TimelineMarker.Type. |
TypeProperty |
Identifies the Type dependency property. Equivalent WinUI property: Microsoft.UI.Xaml.Media.TimelineMarker.TypeProperty. |