2015-04-03 62 views
2

我有一个非常简单的问题。是否有可能在一个闪亮的用户界面中呈现短视频剪辑?在闪亮的用户界面中呈现视频

的想法是有一个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") 

) 
) 
) 

,但我想将视频文件的“测试”对象内。

回答

0

我不知道如何上传视频作为一个文件,但在嵌入YouTube视频,使用HTML代码相当简单:

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") 

) 
) 
) 
+0

喜用下面的代码,我想这个代码。但是当我运行应用程序时,视频不会被加载。 – 2015-04-08 15:28:52

+0

我再次尝试了上面的,为我服务的server.R:shinyServer(函数(输入,输出,会话){})你有任何其他的代码?也许尝试与另一个视频链接? – Chris 2015-04-08 18:05:38

1

这为我工作。

使用呼包'shinyLP'

然后在你的ui.r

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