Setting initial volume?

May 15, 2010 at 6:20 AM

Is there a parameter available to set the initial volume? It seems weird to have it at 50% initially.


May 16, 2010 at 5:57 PM

The available initialization parameters are listed in the documentation here on CodePlex, and volume is not one of them. Yes, the volume of a MediaElement defaults to 50%.

You can do what you want another way though -- you have two simple options:

  • You can easily just edit the source code of the Silverlight Video Player and add your own initialization parameter.
  • Because SIlverlight integrates seamlessly with JavaScript (unlike Flash) you can just write a couple of lines of JavaScript to get the MediaElement and set its volume property. To give you a head start, you may wish to refer to my JavaScript sample code in which I get the MediaElement and manipulate its properties. :)


May 18, 2010 at 8:41 PM

Ok, that seems easy enough. I've got the volume working. Is there a way to access the volume slider via JS to be able to show that the volume is at 100% and/or hide the volume completely?