I am trying to display a dynamic iframe to display youtube videos based on user's input for the URL.
My code does not generate error, but the video does not display, would you have any solution ?
Many thanks in advance!
Regards,
Thomas
My code:
ui.R
box(title = "settings", status = "warning", solidHeader = TRUE, width = 2, textInput("texturli", label = "enter valid Youtube URL", value = "https://www.youtube.com/watch?v=C7mXGMcpA0g"),
actionButton("geturl", label = "launch analysis")
),
box(title = "video", status = "primary", solidHeader = TRUE, width = 3,
tags$iframe(src = "https://www.youtube.com/watch?v=C7mXGMcpA0g"), # this works fine
htmlOutput("test")) # this does not work
server.R
url <- reactive({
input$geturl
isolate(paste0(input$texturli))
})
output$test <- renderUI({
tags$iframe(src = url())
})