A more user friendly way to adjust the volume of the howler than by using buttons. There are still volume up/down buttons, but a slider can be moved up/down as required.

howlerVolumeSlider(id, volume = 1, button = TRUE)

Arguments

id

ID given to the volume slider. For it to work with the howler, the ID must match that of the howler.

volume

Initial volume to set the player at. Defaults at 100%

button

Logical, should a mute toggle button be included next to the slider? Default is TRUE

Value

A volume slider with a howlerVolumeDownButton and a howlerVolumeUpButton either side.

Details

If using howlerVolumeSlider, avoid using the volume buttons, as this will cause duplicate IDs to appear in the shiny application and prevents the slider from working properly.

Examples

if (interactive()) {
  library(shiny)

  ui <- fluidPage(
    title = "howler.js Player",
    howler(elementId = "sound", "audio/sound.mp3"),
    howlerPlayPauseButton("sound"),
    howlerVolumeSlider("sound")
  )

  server <- function(input, output, session) {
  }

  shinyApp(ui, server)
}