How to add videos in a shiny R dashboard

+1 vote
How to add videos in a shiny R dashboard?
Dec 4, 2018 in Data Analytics by Ali
• 11,330 points
1,823 views

1 answer to this question.

0 votes

Its pretty simple, try this:

server.r

library(shiny)
shinyServer(function(input, output, session) {})

ui.r

shinyUI(
  fluidPage(
    tags$video(id="videoID", type = "video/mp4",src = "ExampleVideo_1280x720_1mb.mp4", controls = "controls")
  )
)
answered Dec 4, 2018 by Haseeb
Hi,
I tried the code, but it doesn't work for me. it seems rshiny can not find my video. but i  save it to the subfolder www

Hi, @Betty,

Could you please share your workaround so that we could resolve the issue asap?

Hi, @Gitika,

Thanks for replying.

My R Studio is version 4.0.1 (I thought version may affect, so I updated it from version 3.6 to 4.0. But not helpful)

Below is my code:


library(shiny)

server = function(input, output) {}

ui =fluidPage(tags$video(src = "Peak", type = "video/mp4", controls = T))

shinyApp(ui, server)

I saved my video file in the subfolder "www"


However, it seems my code doesn't work

Hi@Betty,

It seems your browser is not supporting the video format. Try with another video file. And get back to us if you get the same thing.

Hi,

Thanks for suggestion.

I tried different videos and different format, nothing changed. Is there any other way to insert videos into Rshiny dashboard?

Hi, @Betty,

It's quite easy to add a video. To do so please structure your app like so:

server.r

library(shiny)
shinyServer(function(input, output, session) {})

ui.r

shinyUI(
  fluidPage(
    tags$video(id="video2", type = "video/mp4",src = "SampleVideo_1280x720_1mb.mp4", controls = "controls")
  )
)

Related Questions In Data Analytics

0 votes
1 answer

How do I add Icons to my messages on my dashboard which I’m creating using shiny r?

Try something like this: dashboardHeader(title="Edureka", dropdownMenu type = "message", messageItem(from = ...READ MORE

answered Nov 30, 2018 in Data Analytics by Maverick
• 10,840 points
263 views
+5 votes
0 answers
0 votes
1 answer

How to add elements into a list in R?

hey, Add elements into list as below. list = ...READ MORE

answered Sep 30, 2019 in Data Analytics by anonymous
• 33,010 points
238 views
0 votes
1 answer

How to add a new column to a Dataframe in R?

Hi@akhtar, You can add new columns to a ...READ MORE

answered Oct 30, 2020 in Data Analytics by MD
• 95,320 points
200 views
+1 vote
1 answer

Error saying "could not find function "shinyUI"" in shiny R

Its a small spelling mistake that you've ...READ MORE

answered Nov 28, 2018 in Data Analytics by Maverick
• 10,840 points
1,480 views
+1 vote
1 answer

Error saying "could not find function dashboardPage" in shiny R

Include this line in the code: Library(shinydashboard) READ MORE

answered Nov 29, 2018 in Data Analytics by Maverick
• 10,840 points
1,393 views
0 votes
2 answers

How to add sliderbars in a shiny R dashboard?

To add slider bar and slider range ...READ MORE

answered Dec 5, 2018 in Data Analytics by Kalgi
• 52,370 points
545 views
0 votes
1 answer

How to write a custom function which will replace all the missing values in a vector with the mean of values in R?

Consider this vector: a<-c(1,2,3,NA,4,5,NA,NA) Write the function to impute ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,720 points
2,516 views