EndPosition Property

Gets or sets the end position.

Namespace:  Microsoft.Web.Media.SmoothStreaming
Assembly:  Microsoft.Web.Media.SmoothStreaming (in Microsoft.Web.Media.SmoothStreaming.dll)

property TimeSpan EndPosition {
	TimeSpan get ();
	void set (TimeSpan value);

Property Value

Type: System..::..TimeSpan
The end position.

For more information, see Events (IIS Smooth Streaming).

The following example shows a delegate that calculates a new position value from the slider input and the EndPosition property. It reassigns the Position property so that the media stream will resume playing at a new position.

    private void SeekBar_ValueChanged(object sender,
                             RoutedPropertyChangedEventArgs<double> e)
        // Calculate proportion of slider length at current position.
        sliderProportion =  ((Slider)sender).Value/((Slider)sender).Maximum;
        // Get media length in seconds.
        sliderLengthSeconds = SmoothPlayer.EndPosition.TotalSeconds;
        // Calculate position in seconds.
        conversion = sliderProportion * sliderLengthSeconds;
        // Convert seconds to a TimeSpan object.
        tsPositionFromSlider = TimeSpan.FromSeconds(conversion);
        // Assign new position by TimeSpan.
        SmoothPlayer.Position = tsPositionFromSlider;


Supported in: 4

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.0