VolumeButton

Controls player volume and mute state

Props

  • icon {string} - The URL for the button icon.
  • isPlayerMuted {boolean} - Is the player muted

API

player.ekoshell.VolumeButton

  • changeVolume(newValue {number}) - Sets the player’s volume. newValue is between 0 and 1. If newValue is 0, then the player will be considered muted.
  • toggleMute() - Toggles the player’s mute mode.
  • showVolume(e {event}) - Shows the volume slider.
  • hideVolume() - Hides the volume slider.
  • activateVolume() - Marks the volume slider as “active” (being currently dragged by pointer device).
  • deactivateVolume() - Marks the volume slider as not “active”.

Events

  • VOLUME_MUTE: 'ekoshell.button.volume.mute'
  • VOLUME_UNMUTE: 'ekoshell.button.volume.unmute'
  • VOLUME_OPEN: 'ekoshell.menu.volume.open'

parentContainer

ControlsOverlay_buttonRow

Plugin Options

"volumebutton": {
    "anyOf": [
        {
            "type": "boolean"
        },
        {
            "type": "object",
            "properties": {
                "icon": {
                    "type": "object",
                    "required": [
                        "default",
                        "muted"
                    ],
                    "properties": {
                        "default": {
                            "type": "string",
                            "description": "URL of icon to show for default state"
                        },
                        "muted": {
                            "type": "string",
                            "description": "URL of icon to show for muted state"
                        }
                    }
                },
                "order": {
                    "type": "integer"
                },
                "parentContainer": {
                    "type": "string"
                }
            }
        }
    ]
},

Notes

  • This addon is not available on mobile, where sound is controlled by the OS
  • Adds SHOW_VOLUME_SLIDER to the ControlsOverlay‘s AutoHide action list.
  • activateVolume()/deactivateVolume() must be called when the volume slider starts/ends being dragged by a pointing device do prevent the slider from automatically closing while still dragging.
  • The button and volume slider should be disabled if overlayed by a different addon (for example, when the ShareScreen addon is visible on top)
Rate this page: X
Tell us more!