'How to play local video in shiny app?(Windows)

I tried the follow code:

shinyUI(
  fluidPage(
    tags$video(id="video2", type = "video/mp4",src = "sample.mp4", controls = "controls")
  )
)
shinyServer(function(input, output, session){})

But, it returns a blank page,

enter image description here

How should I do to play the video?



Solution 1:[1]

For me it's working. Have you put your video in the www folder?

Also, have a look at this question, it's quite similar: Embed Video with Live Controls into Interactive Shiny Environment

Solution 2:[2]

For anyone late to this question - it won't play in RStudio's 'Run App' environment - launch your app to the browser and it seems to work fine.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Thomas
Solution 2 Duke Showbiz