MediaTimelineController Class

Definition

Provides information about and control over the rate, position, and state of a MediaPlayer. This class makes it possible to control and synchronize multiple media players from a single controller and makes it easier to create custom transport controls.

public ref class MediaTimelineController sealed
/// [Windows.Foundation.Metadata.Activatable(196608, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class MediaTimelineController final
[Windows.Foundation.Metadata.Activatable(196608, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class MediaTimelineController
function MediaTimelineController()
Public NotInheritable Class MediaTimelineController
Inheritance
Object Platform::Object IInspectable MediaTimelineController
Attributes

Windows requirements

Device family
Windows 10 Anniversary Edition (introduced in 10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v3.0)

Remarks

Get an instance of this class using the constructor or by accessing the TimelineController property of a MediaPlayer.

Version history

Windows version SDK version Value added
1703 15063 Duration
1703 15063 Ended
1703 15063 Failed
1703 15063 IsLoopingEnabled

Constructors

MediaTimelineController()

Initializes a new instance of the MediaTimelineController class.

Properties

ClockRate

Gets or sets the speed at which the position of the MediaTimelineController changes, expressed as a ratio to normal playback speed. For example, setting a value of 1.0 will result in normal playback speed, a value of 4.0 will result in a playback speed 4 times the normal speed.

Duration

Gets a value indicating the duration of the timeline. After the specified time span has elapsed, the timeline clock will no longer progress.

IsLoopingEnabled

Gets a value indicating whether the timeline will loop, restarting the clock at zero, when it reaches the end of the time window specified by the Duration.

Position

Gets or sets the current position of the MediaTimelineController.

State

Gets a value indicating the current state of the MediaTimelineController, which can be either running or paused.

Methods

Pause()

Pauses playback of the MediaTimelineController.

Resume()

Resumes the playback of the MediaTimelineController from the position at which the controller was paused.

Start()

Starts the playback of the MediaTimelineController from the position 0.

Events

Ended

Occurs when the timeline controller reaches the end of the time window specified by the Duration if IsLoopingEnabled is set to false.

Failed

Occurs when the timeline controller encounters an internal error and can't continue playback.

PositionChanged

Occurs when the position of the MediaTimelineController changes.

StateChanged

Occurs when the state of the MediaTimelineController changes.

Applies to

See also