1

I have a simple piece of code with a video (mp4) file and this does not work. Shows a 'broken' (crossed out) video image with play button and nothing else. Any idea what I am doing wrong?

I place the video file in the www folder. I also tried to place it in the top level app folder where app.R is. This is with the Shiny Server (free version) on a Ubuntu Linux instance

ui <- fluidPage(
  tags$video(
    src = 'myVideo.mp4',
    type = 'video/mp4',
    autoplay = 'autoplay',
    controls = 'controls'
    )
  )

server <- function(input, output, session) {
  }

shinyApp(ui = ui, server = server)

Here is the screen shot of what I see:

my screen shot

I see the following in my log file:

Listening on http://127.0.0.1:40086

I don't see anything else in the log file.

Gopala
  • 10,363
  • 7
  • 45
  • 77
  • I used the code that you provided with my own mp4 and everything worked as expected. I suggest you first try it out with an image to see if your app finds the file. Also run the app in your browser, not in the R studio window. Did you try this solution? https://stackoverflow.com/questions/38011285/image-not-showing-in-shiny-app-r/46546344#46546344 – Wilmar van Ommeren Nov 08 '19 at 07:19
  • make sure you use `runApp()` to have the parent folder of www as the working directory. or start the app with the runapp button in rstudio,... – Tonio Liebrand Nov 08 '19 at 15:18
  • Images work fine and everything is organized right. Bizarrely, the same code works if my video file is on AWS S3 with a URL. Not in the local www folder. No idea why. – Gopala Nov 10 '19 at 14:58

0 Answers0