Windows Media Player 11 SDK Adding a SliderĀ 

Windows Media Player SDK banner art

Previous Next

Adding a Slider

You can add a slider to show the current position of the media, and also enable the user to change the position in the current media file.

First you must add the SLIDER element:

  

This sets a maximum value based on the duration of the current media file. This uses a tiny thumb image bitmap that is just a 10 pixel by 10 pixel green square. The background of the slider will be red and the foreground will be blue. When the user drags the thumb image to a new position and lets go of the mouse button, the media will change to that position.

But the slider will not move by itself unless you measure the current position with the currentPosition_onchange attribute of the CONTROLS element, which is embedded in the PLAYER element.

  

When the position of the media changes, this fires an event which then runs the line of code that changes the value of the slider to the current position of the media.

You can see a similar working slider skin in the sample section of the SDK.

See Also

Previous Next