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,360 points
4,100 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
886 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,030 points
731 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,460 points
732 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
2,646 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
3,698 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,350 points
1,472 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,750 points
4,593 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP