SmoothStreamingMediaElement.Position Property
Gets or sets the position in the current stream.
Namespace: Microsoft.Web.Media.SmoothStreaming
Assembly: Microsoft.Web.Media.SmoothStreaming (in Microsoft.Web.Media.SmoothStreaming.dll)
Syntax
'Declaration
Public Property Position As TimeSpan
Get
Set
'Usage
Dim instance As SmoothStreamingMediaElement
Dim value As TimeSpan
value = instance.Position
instance.Position = value
public TimeSpan Position { get; set; }
public:
property TimeSpan Position {
TimeSpan get ();
void set (TimeSpan value);
}
member Position : TimeSpan with get, set
function get Position () : TimeSpan
function set Position (value : TimeSpan)
Property Value
Type: System.TimeSpan
The position in the current stream.
Remarks
For more information and for examples, see Position in Stream and Events.
Examples
The following example shows a delegate that assigns the Position property. Each time the user clicks the SeekButton element, the event handler adds a five-second interval to the position property until the current position plus five seconds is greater than the length of the media stream as specified by the EndPosition property.
// Button seek interval.
TimeSpan spanAdd = new TimeSpan(0, 0, 5);
private void SeekButton_Click(object sender, RoutedEventArgs e)
{
if ((SmoothPlayer.Position + spanAdd) < SmoothPlayer.EndPosition)
{
SmoothPlayer.Position += spanAdd;
}
}
Version Information
Silverlight
Supported in: 5
Windows Phone
Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0