Silverlight Video Player updated to display external bookmarks
Last week someone requested a new feature to the Silverlight 2 Video player on CodePlex that would allow users to create an external list of “bookmarks”, that would link to a specific marker or moment in playback. The idea would be to have a series of links outside of Silverlight, that once clicked,playback would jump to that moment in the video.
When I originally created marker support I had given this some thought and was just waiting for the opportunity to add this feature. I am excited someone really wants it. Back in July I created a post called Communicating between two Silverlight objects on a single page. In this post I demonstrate how one can use a [ScriptableMember] to expose a method to JavaScript. To add this feature to the Video Player I can use this technique.
The first step was to create a method in my mediaControls control, which would allow a time (TimeSpan) to be passed during playback. This call will jump the slider to that position in time and begin or continue playback.
Once we have a method in mediaControl we can expose a scriptable method in Page.xaml. This method can be called from any page hosting out Silverlight XAP.
To demonstrate how to use this method I created a sample html page that presents a list of bookmarks that target the video player. Each link calls a JavaScript method, that in turn calls my [ScritableMember]







