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:Stringdefault:POSITIONS.ROOT_RIGHTFor specific enumeration values, please see plugin-positions
index
@type:Numberdefault:1
showValueLabel
@type:Booleandefault:false
Whether to display the current volume value of the slide
default
@type:Numberdefault:0.6
Default volume, when playerConfig.volume is number, take playerConfig.volume
showValueLabel
@type:Booleandefault:false
Whether to display the current volume percentage at the top of the volume adjustment bar
miniVolume
@type:Numberdefault: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
}
})