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 : IMediaTimelineController, IMediaTimelineController2public sealed class MediaTimelineController : IMediaTimelineController, IMediaTimelineController2Public NotInheritable Class MediaTimelineController Implements IMediaTimelineController, IMediaTimelineController2// You can use this class in JavaScript.
- Attributes
| 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()
Initializes a new instance of the MediaTimelineController class.
public : MediaTimelineController()public MediaTimelineController()Public Sub New()// You can use this method in JavaScript.
Properties
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.
public : double ClockRate { get; set; }public double ClockRate { get; set; }Public ReadWrite Property ClockRate As double// You can use this property in JavaScript.
- Value
- double double double double
The speed at which the position of the MediaTimelineController changes.
Remarks
Only positive values are supported for ClockRate. Attempting to set a negative value will result in an argument exception.
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.
public : IReference<TimeSpan> Duration { get; set; }public Nullable<TimeSpan> Duration { get; set; }Public ReadWrite Property Duration As Nullable<TimeSpan>// You can use this property in JavaScript.
- Value
- IReference<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan>
A value indicating the duration of the timeline.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
Remarks
The Ended event is raised when the timeline controller reaches the end of the Duration time window.
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.
public : PlatForm::Boolean IsLoopingEnabled { get; set; }public bool IsLoopingEnabled { get; set; }Public ReadWrite Property IsLoopingEnabled As bool// You can use this property in JavaScript.
- Value
- PlatForm::Boolean bool bool bool
True if looping is enabled; otherwise, false.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
Position Position Position Position
Gets or sets the current position of the MediaTimelineController.
public : TimeSpan Position { get; set; }public TimeSpan Position { get; set; }Public ReadWrite Property Position As TimeSpan// You can use this property in JavaScript.
- Value
- TimeSpan TimeSpan TimeSpan TimeSpan
The current position of the MediaTimelineController.
Remarks
To receive periodic notifications when the timeline controller's position changes, handle the PositionChanged event.
State State State State
Gets a value indicating the current state of the MediaTimelineController, which can be either running or paused.
public : MediaTimelineControllerState State { get; }public MediaTimelineControllerState State { get; }Public ReadOnly Property State As MediaTimelineControllerState// You can use this property in JavaScript.
- Value
- MediaTimelineControllerState MediaTimelineControllerState MediaTimelineControllerState MediaTimelineControllerState
A value indicating the current state of the MediaTimelineController
Remarks
To receive notifications when the state of the MediaTimelineController changes, handle the StateChanged event.
Methods
Pause() Pause() Pause() Pause()
Pauses playback of the MediaTimelineController.
public : void Pause()public void Pause()Public Function Pause() As void// You can use this method in JavaScript.
Resume() Resume() Resume() Resume()
Resumes the playback of the MediaTimelineController from the position at which the controller was paused.
public : void Resume()public void Resume()Public Function Resume() As void// You can use this method in JavaScript.
Remarks
To restart the MediaTimelineController at position 0, call Start instead.
Start() Start() Start() Start()
Starts the playback of the MediaTimelineController from the position 0.
public : void Start()public void Start()Public Function Start() As void// You can use this method in JavaScript.
Remarks
To resume playback of a paused MediaTimelineController without resetting the position to 0, call Pause instead.
Events
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.
public : event TypedEventHandler Ended<MediaTimelineController, object>public event TypedEventHandler Ended<MediaTimelineController, object>Public Event Ended<MediaTimelineController, object>// You can use this event in JavaScript.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
Failed Failed Failed Failed
Occurs when the timeline controller encounters an internal error and can't continue playback.
public : event TypedEventHandler Failed<MediaTimelineController, MediaTimelineControllerFailedEventArgs>public event TypedEventHandler Failed<MediaTimelineController, MediaTimelineControllerFailedEventArgs>Public Event Failed<MediaTimelineController, MediaTimelineControllerFailedEventArgs>// You can use this event in JavaScript.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
PositionChanged PositionChanged PositionChanged PositionChanged
Occurs when the position of the MediaTimelineController changes.
public : event TypedEventHandler PositionChanged<MediaTimelineController, object>public event TypedEventHandler PositionChanged<MediaTimelineController, object>Public Event PositionChanged<MediaTimelineController, object>// You can use this event in JavaScript.
Remarks
This event is raised by the system several times per second while the position of the MediaTimelineController is changing.
StateChanged StateChanged StateChanged StateChanged
Occurs when the state of the MediaTimelineController changes.
public : event TypedEventHandler StateChanged<MediaTimelineController, object>public event TypedEventHandler StateChanged<MediaTimelineController, object>Public Event StateChanged<MediaTimelineController, object>// You can use this event in JavaScript.