Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 在闪亮的UI中呈现视频_R_Video_Shiny - Fatal编程技术网

R 在闪亮的UI中呈现视频

R 在闪亮的UI中呈现视频,r,video,shiny,R,Video,Shiny,我有一个非常简单的问题。是否可以在闪亮的UI中渲染短视频剪辑 其想法是要有一个与此类似的UI shinyUI(pageWithSidebar( headerPanel("Welcome to the Experiment"), sidebarPanel( actionButton("runButton", "Roll the dice"), helpText("You have x draws"), helpText("Your Draw"), uiOu

我有一个非常简单的问题。是否可以在闪亮的UI中渲染短视频剪辑

其想法是要有一个与此类似的UI

shinyUI(pageWithSidebar(
  headerPanel("Welcome to the Experiment"),
  sidebarPanel(
    actionButton("runButton", "Roll the dice"),
    helpText("You have x draws"),
    helpText("Your Draw"), 
    uiOutput('test',align="center")

  ),
  mainPanel(
    helpText("Your draw"),
    tableOutput("first"),
    br(),
    br(),
    br(),
    img(src='dice1.png', align = "right"),
    helpText("Your redemption Coupon Code is"),
    tableOutput("second")

  )
)
)

但是我想在“test”对象中放置一个视频文件。

我不确定如何将视频作为文件上传,但是使用HTML代码嵌入YouTube视频非常简单:

shinyUI(pageWithSidebar(
  headerPanel("Welcome to the Experiment"),
  sidebarPanel(
    actionButton("runButton", "Roll the dice"),
    helpText("You have x draws"),
    helpText("Your Draw"), 
    HTML('<iframe width="200" height="100" src="//www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allowfullscreen></iframe>')

  ),
  mainPanel(
    helpText("Your draw"),
    tableOutput("first"),
    br(),
    br(),
    br(),
    img(src='dice1.png', align = "right"),
    helpText("Your redemption Coupon Code is"),
    tableOutput("second")

  )
)
)
shinyUI(带侧栏的页面)(
headerPanel(“欢迎参加实验”),
侧栏面板(
actionButton(“runButton”,“掷骰子”),
helpText(“您有x个绘图”),
helpText(“您的绘图”),
HTML(“”)
),
主面板(
helpText(“您的绘图”),
表格输出(“第一”),
br(),
br(),
br(),
img(src='dice1.png',align=“right”),
helpText(“您的兑换优惠券代码为”),
表格输出(“秒”)
)
)
)
这对我很有效

使用名为“shinyLP”的软件包

然后在您的
ui.r

iframe(width = "250", height = "150",url_link="www.youtube.com/embed/dQw4w9WgXcQ")

嗨,我试过这个密码。但是当我运行应用程序时,视频没有加载。我再次尝试了上面的方法,对我的服务器有效。R of:shinyServer(函数(输入、输出、会话){})你还有其他代码吗?也许可以尝试另一个视频链接?