Share via


MediaPlayer.Volume Property

Gets or sets the initial volume setting as a value between 0 and 1.

Namespace:  System.Web.UI.SilverlightControls
Assembly:  System.Web.Silverlight (in System.Web.Silverlight.dll)

Syntax

'Declaration
<ThemeableAttribute(True)> _
<BrowsableAttribute(True)> _
Public Overridable Property Volume As Double
    Get
    Set
'Usage
Dim instance As MediaPlayer
Dim value As Double

value = instance.Volume

instance.Volume = value
[ThemeableAttribute(true)]
[BrowsableAttribute(true)]
public virtual double Volume { get; set; }

Property Value

Type: System.Double
The initial setting for the volume of the Sys.UI.Silverlight.MediaPlayer client control in the Web page. The default value is .5.

Exceptions

Exception Condition
ArgumentOutOfRangeException

The Volume property is set to a value that is less than 0 or greater than 1.

Remarks

The Volume property sets the initial value for the Sys.UI.Silverlight.MediaPlayer client control.

The volume for the Sys.UI.Silverlight.MediaPlayer client control can be changed by the user at runtime or changed programmatically by setting the Volume property on the Sys.UI.Silverlight.MediaPlayer client control at runtime.

When the volume changes at runtime, a Sys.UI.Silverlight.MediaPlayer.volumeChanged client event occurs.

You can indicate the name of the JavaScript function to run when a Sys.UI.Silverlight.MediaPlayer.volumeChanged client event occurs by setting a value for the OnClientVolumeChanged property.

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

MediaPlayer Class

MediaPlayer Members

System.Web.UI.SilverlightControls Namespace