Megosztás a következőn keresztül:


MediaPlayer.Position Property

Definition

Gets or sets the playback position within the media.

Note

MediaPlayer.Position may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the MediaPlaybackSession.Position property.

public:
 property TimeSpan Position { TimeSpan get(); void set(TimeSpan value); };
TimeSpan Position();

void Position(TimeSpan value);
/// [get: Windows.Foundation.Metadata.Deprecated("Use PlaybackSession.Position instead of Position.  For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 196608, "Windows.Foundation.UniversalApiContract")]
/// [set: Windows.Foundation.Metadata.Deprecated("Use PlaybackSession.Position instead of Position.  For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 196608, "Windows.Foundation.UniversalApiContract")]
TimeSpan Position();

void Position(TimeSpan value);
public System.TimeSpan Position { get; set; }
public System.TimeSpan Position { [Windows.Foundation.Metadata.Deprecated("Use PlaybackSession.Position instead of Position.  For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 196608, "Windows.Foundation.UniversalApiContract")] get; [Windows.Foundation.Metadata.Deprecated("Use PlaybackSession.Position instead of Position.  For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 196608, "Windows.Foundation.UniversalApiContract")] set; }
var timeSpan = mediaPlayer.position;
mediaPlayer.position = timeSpan;
Public Property Position As TimeSpan

Property Value

The playback position within the media.

Attributes

Remarks

The position can't be moved forward while a MediaPlaybackItem with CanSkip set to false is playing. Attempting to do so will cause an exception to be thrown.

Applies to