共用方式為


NaturalDuration

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets the natural duration of the media.

value = object.NaturalDuration

Property Value

Type: Duration

The natural duration of the media.

This property is read-only. The default value is Automatic, which is the value held if you query this property before the MediaOpened event.

Managed Equivalent

NaturalDuration

Remarks

The property value is not available until the MediaOpened event has been raised.

If the opened media is live streaming media, NaturalDuration is null.

When you have the Duration value, you can get its Seconds property value.

Applies To

MediaElement