Is there a way to play the youtube video that is displayed inside a modal in a second pop up modal when I click to play the video in a shiny app?
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(disable = T),
dashboardBody(
actionButton('info', 'Information')
)
)
server <- function(input, output) {
observeEvent(input$info,{
showModal(modalDialog(
title = span(h3(strong("Distribution of cumulative reported cases (logarithmic scale)"), style = 'font-size:16px;color:#6cbabf;')),
fluidRow(
actionButton('hit', 'Open video in popup'),
observeEvent(input$hit,{
showModal(modalDialog(
title = "Video",
HTML(paste0('<iframe width="860" height="500" src="https://www.youtube.com/embed/' ,"aQlTAznANDQ",'" frameborder="0" allowfullscreen></iframe>')),
size = 'l'
))
})
)
))
})
}
shinyApp(ui, server)
