I have a flexdashboard that has a runtime of shiny. I’m looking to allow the user to select an input and for an associated mp4 file to play. All videos are stored within the working directory of the .Rmd file. The current code I have identifies theres a video to play but cant play. In the inspect element selection I get the following error: Failed to load resource: the server responded with a status of 404 (Not Found)
title: “My App”
output:
flexdashboard::flex_dashboard:
theme: cerulean
orientation: columns
vertical_layout: fill
runtime: shiny
Vision Library
Column {data-width=10}
Select Drill
# Create a selection input
selectInput("selected_name", "Select Input:", choices = unique(database$`Person Name`), selected = NULL)
Column {data-width=70}
Vision Library
# Placeholder for dynamic video path generation
output$video_output <- renderUI({
req(input$selected_name) # Ensure a drill is selected
video_file <- paste0(input$selected_name, ".mp4") # Assuming videos are named after people
# If the video file exists in the working directory, display it
if (file.exists(video_file)) {
tags$video(src = video_file, type = "video/mp4", controls = TRUE, autoplay = TRUE, width = "100%")
} else {
h4("Video not found for this drill.")
}
})
# Display the selected video
uiOutput("video_output")
Notes
I have tried embedding the video without dynamic selection, which works
S.Parker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.