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)
ID to give to the namespace of the module. The howler player will have the ID {id}-howler
.
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
Logical, should the current track be included in the UI of the module?
Width (in pixels) of the player. Defaults to 400px.
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:
Logical value whether or not the player is currently playing
Name of the track currently loaded
Duration (in seconds) of the track currently loaded
Current position (in seconds) of the track currently loaded
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)
}