A simple module containing a howler player and a default set of howler buttons. The module also contains the current position of the track being played and the duration of the track.

howlerModuleUI(id, files, ..., include_current_track = TRUE, width = "300px")

howlerBasicModuleUI(id, files, ..., width = "300px")

howlerModuleServer(id)

Arguments

id

ID to give to the namespace of the module. The howler player will have the ID {id}-howler.

files

Files that will be used in the player. This can either be a single vector, or a list where different formats of the same file are kept in each element of the list.

...

Further arguments to send to howler

include_current_track

Logical, should the current track be included in the UI of the module?

width

Width (in pixels) of the player. Defaults to 400px.

Value

The UI will provide a player with a play/pause button, previous and next buttons, duration information and a volume slider.

The server-side module will return a list of reactive objects:

playing

Logical value whether or not the player is currently playing

track

Name of the track currently loaded

duration

Duration (in seconds) of the track currently loaded

seek

Current position (in seconds) of the track currently loaded

Examples

if (interactive()) {
  ui <- fluidPage(
    title = "howler.js Module",
    howlerModuleUI("howl", c("audio/track1.mp3", "audio/track2.mp3"))
  )

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

  shinyApp(ui, server)
}