Change the state of the howler player from the server.
playHowl
, pauseHowl
, togglePlayHowl
and stopHowl
will all be applied to the current track.
changeTrack
will update the track to the file specified.
addTrack
will add a new track to the specified player.
changeTrack(id, track, session = getDefaultReactiveDomain())
addTrack(id, track, play_track = FALSE, session = getDefaultReactiveDomain())
deleteTrack(id, track, session = getDefaultReactiveDomain())
playHowl(id, session = getDefaultReactiveDomain())
pauseHowl(id, session = getDefaultReactiveDomain())
togglePlayHowl(id, session = getDefaultReactiveDomain())
stopHowl(id, session = getDefaultReactiveDomain())
seekHowl(id, seek, session = getDefaultReactiveDomain())
changeHowlSpeed(id, rate = 1, session = getDefaultReactiveDomain())
ID of the howler
to update
Either the track name of the file to change to, or the index of the file to play. If the file is not included in the player nothing will happen.
Shiny session
Logical, should the new track be played on addition?
Time (in seconds) to set the position of the track
Rate (from 0.5 to 4.0) of the audio playback speed
Updates the the state of the specified howler
in the shiny application.
For `deleteTrack`, make sure that the name is used of the track rather than the file name.
if (interactive()) {
library(shiny)
tracks <- c("audio/track1.mp3", "audio/track2.mp3")
ui <- fluidPage(
title = "howler.js Player",
selectInput("track", "Select Track", basename(tracks)),
howler(elementId = "howler", tracks),
howlerPlayPauseButton("howler")
)
server <- function(input, output) {
observeEvent(input$track, changeHowlerTrack("howler", input$track))
}
runShiny(ui, server)
}