Home > Net >  HTML5 Video tag suddenly stopped working on Safari desktop
HTML5 Video tag suddenly stopped working on Safari desktop

Time:10-30

I have read through and tried suggested solutions on many other similar questions to this one, but nothing is working. When I initially deployed this code a few months ago, it was working on all browsers, mobile and desktop. Now, suddenly, there's no video rendering on Safari (desktop only—it still works on mobile).

<video muted
       playsinline
       disablepictureinpicture
       loop
       class="video"
       preload="metadata">
  <source src="assets/videos/cl.mp4" type="video/mp4"/>
  <source src="assets/videos/cl.mov" type="video/mov"/>
  <p>Your browser does not support HTML5 video.</p>
</video>

The unsupported message doesn't render, but no video renders either. Did something change with Safari recently? What else do I need to get this working again?

I have tried:

  1. re-encoding the mp4 file with:
ffmpeg -i cl.mp4 -vcodec libx264 -acodec aac -movflags faststart cl-encoded.mp4
  1. adding the controls attribute
  2. adding multiple source types

CodePudding user response:

This may be due to the lack of 'ogg' format.

CodePudding user response:

<video class="video-background" autoplay loop muted playsinline>

It works when you include a playinline word and add the source file

  • Related