MediaTimelineController MediaTimelineController MediaTimelineController MediaTimelineController 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 : sealed class MediaTimelineController
struct winrt::Windows::Media::MediaTimelineController
public sealed class MediaTimelineController
Public NotInheritable Class MediaTimelineController
var mediaTimelineController = new mediaTimelineController();
Attributes

Windows 10 requirements

Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

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

Constructors

MediaTimelineController() MediaTimelineController() MediaTimelineController() MediaTimelineController() MediaTimelineController()

Initializes a new instance of the MediaTimelineController class.

Properties

ClockRate ClockRate ClockRate ClockRate 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 Duration Duration Duration 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 IsLoopingEnabled IsLoopingEnabled IsLoopingEnabled 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 Position Position Position Position

Gets or sets the current position of the MediaTimelineController.

State State State State State

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

Methods

Pause() Pause() Pause() Pause() Pause()

Pauses playback of the MediaTimelineController.

Resume() Resume() Resume() Resume() Resume()

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

Start() Start() Start() Start() Start()

Starts the playback of the MediaTimelineController from the position 0.

Events

Ended Ended Ended Ended Ended

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

Failed Failed Failed Failed Failed

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

PositionChanged PositionChanged PositionChanged PositionChanged PositionChanged

Occurs when the position of the MediaTimelineController changes.

StateChanged StateChanged StateChanged StateChanged StateChanged

Occurs when the state of the MediaTimelineController changes.

See also