HTML5 video not running on mobile

Asked

Viewed 207 times

1

I am creating a project in which I have a video rolling on the page in the background, the desktop version is working perfectly, but in mobile the video does not run and is only the blue screen (div I put to give an opacity in the video).

<video autoplay loop id="video-background" muted>
 <source src="expo.mp4" type="video/webm">
</video>

Test server: https://cliente.creativecode.art.br/expotattoo.html

Can someone help me?

  • Mobile or mobile version?

  • Cellular, or mobile, I think it’s the same

  • no... you can open the mobile version on the desktop

  • Anyway, the cell is not going

1 answer

1

As answered here, mobile devices do not run videos on background. It is interesting to include the attribute poster on the tag <video>, which will display a still image in place of the video.

So that the background does not only have one color, put in poster an image related to the video:

<video autoplay loop id="video-background" muted poster="imagem.jpg">

Browser other questions tagged

You are not signed in. Login or sign up in order to post.