volume
Volume control plugin SourceCode
pluginName: volume
Function description:
- Slide the slider to adjust the volume
- Click the button to switch the mute state
config
position
@type
:String
default
:POSITIONS.ROOT_RIGHT
For specific enumeration values, please see plugin-positions
index
@type
:Number
default
:1
showValueLabel
@type
:Boolean
default
:false
Whether to display the current volume value of the slide
default
@type
:Number
default
:0.6
Default volume, when playerConfig.volume is number, take playerConfig.volume
showValueLabel
@type
:Boolean
default
:false
Whether to display the current volume percentage at the top of the volume adjustment bar
miniVolume
@type
:Number
default
:0.2
Minimum volume when mute resumes
hooks
mutedChange
@desc
: Click the button to switch the mute state
player.usePluginHooks('volume','mutedChange', (plugin) => {
// TODO
return true
})
demo
const player = new Player({
...,
volume: 1
})
const player = new Player({
...,
volume: {
default: 1,
showValueLabel: true
}
})