MediaPlayer.NaturalDuration Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Get the actual duration of the media without applying the PlaybackRate.
Note
MediaPlayer.NaturalDuration 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.NaturalDuration property.
public:
property TimeSpan NaturalDuration { TimeSpan get(); };
TimeSpan NaturalDuration();
/// [get: Windows.Foundation.Metadata.Deprecated("Use PlaybackSession.NaturalDuration instead of NaturalDuration. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 196608, "Windows.Foundation.UniversalApiContract")]
TimeSpan NaturalDuration();
public System.TimeSpan NaturalDuration { get; }
public System.TimeSpan NaturalDuration { [Windows.Foundation.Metadata.Deprecated("Use PlaybackSession.NaturalDuration instead of NaturalDuration. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 196608, "Windows.Foundation.UniversalApiContract")] get; }
var timeSpan = mediaPlayer.naturalDuration;
Public ReadOnly Property NaturalDuration As TimeSpan
Property Value
The actual duration of the media without applying the PlaybackRate.
- Attributes