Dash html.Video type attribute

I’ve got a video I want to play automatically but it doesn’t start playing unless I manually go in the html and add the type="video/mp4" attribute. But Dash.html doesn’t let you use the type keyword to set this and no parameter exists to set this as far as I know. Any workaround to this that anyone is aware of or do I have to use the dash-dangerously-set-inner-html library?

html.Video(
  src='assets/animation.mp4',
  autoPlay=True,
  loop=True
 )

HI @russhopper, did you try with a different video?

It wasn’t the video that was the problem but I was trying a few different things today and it looks like I just needed to set autoPlay=True. I had thought I did that but now it’s working. Here’s my working code for reference:

html.Video(
  'Your browser does not support HTML5 video.',
  src='assets/background animation.mp4',
  autoPlay=True,
  muted=True,
  loop=True
)
1 Like

image

Hello, I ran into the same issue and would like to point out that autoPlay seems to only work when muted is also set to True, at least on firefox.