Determine the media position when playing a video in Silverlight

How could you determine the media position when playing a video in Silverlight?

- The elements mePlayer.width and mePlayer.height retrieves the positions of the media in silver light.

- The source of the media player is set by mePlayer.Source , using the uri resource.

- The position property is available to expose the information.

- This property is of TimeSpan so care should be taken while calculating these values.

- Subproperty of TimeSpan is TotalSeconds that helps in converting the TimeSpan property into float value.

- The length of the media is determined with the Video.NaturalDuration.TimeSpan.TotalSeconds.

- The easiest way is to determine the position of the progress bar and then just add the relativePosition value:
Canvas.SetLeft(progressPointer, Canvas.GetLeft(progressBar) + relativePosition);

- Silverlight does not have a working timer component. But there is a neat workaround.
Ways of accessing the Silverlight control
The object tag is used to identify and store the silverlight controls...
Information that the Silverlight plug-in exposes to JavaScript
Information that the Silverlight plug-in exposes - 1. System.Browser name space and DOM...
How could you modify XAML content from JavaScript? - Silverlight
How could you modify XAML content from JavaScript? - Place xaml in Java Script using createFromXaml function...
Post your comment