西瓜播放器 HTML5 video video.js 播放器 HTML5播放器 mp4 hls hls.js flv flv.js dash dash.js 无缝切换

volume

Volume control plugin SourceCode

pluginName: volume

Function description:

  1. Slide the slider to adjust the volume
  2. Click the button to switch the mute state

config

position

  • @type: String
  • default: POSITIONS.ROOT_RIGHTFor 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
  }
})