【发布时间】:2021-08-17 10:58:45
【问题描述】:
当我点击在shiny 应用程序中播放视频时,有没有办法在第二个弹出模式中播放显示在模式内的 youtube 视频?
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)
【问题讨论】:
标签: javascript r video shiny modal-dialog