Provide volume control

You can set up a user interface control for sound volume.

  1. Wait for the MediaPlayer instance to be in a valid status for this command.

    Any state except for except RELEASED is valid.

  2. Call the volume set method on the MediaPlayer instance to set the audio volume.

    public function set volume(value:Number):void

    The value for the volume represents the requested volume expressed as a proportion of the maximum volume, where 0 is silent and 1 is the maximum volume.

    If the specified volume is The resulting volume is
    Less than 0 0
    Between 0 and 1 The specified volume
    Greater than 1 The value divided by 100 and set to one of the following values:
    • The result if it is between 0 and 1
    • 1 if the result is greater than 1

    Tip: This logic handles values that are supplied from clients based on earlier versions of the phrases/primetime-sdk-name, where volume values ranged from 0 to 100.

On this page