Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

242
Visualizações
Safari iOS 15 video issue

Since I downloaded iOS 15, the video on my page no longer works (in Safari). I used the following code to embed the video.

<video id="video" autoplay="true" loop="true" muted="true" playsinline="true">
    <source src="media/video.mp4" type="video/mp4">
</video>

If I deactivate "GPU Process: Media" in the Safari settings, everything works again as before.

Do I have to embed the video differently?

over 4 years ago · Santiago Trujillo
4 Respostas
Responde à pergunta

0

I was doing some experiments on this and found that the video will start working when we do pause and play.

   const rVideo = document.getElementById("videoElement");
    if (rVideo) {
      rVideo.pause();
      rVideo
        .play()
        .then((res) => {
          console.log("playing start", res);
        })
        .catch((err) => {
          console.log("error playing", err);
        });
    }

It's not a perfect solution but a workaround to make it work.

over 4 years ago · Santiago Trujillo Relatório

0

You can fix the black screen by using setTimeout as follows:

this.video.pause();
setTimeout(() => {
    this.video.play().then((res) => {
        console.log("playing start", res);
    })
    .catch((err) => {
        console.log("error playing", err);
    });
}, 0);
over 4 years ago · Santiago Trujillo Relatório

0

Just wrap the video tag in div. I'm guessing that you positioned your video tag absolute or fixed. There seems to be a bug with that. Positioning the wrapper div fixed/absolute instead of the video element seems to help. It might also help to give the video element a background-color.

over 4 years ago · Santiago Trujillo Relatório

0

To be correctly served on iOS devices, the videos must be able to be requested even partially as specified by Apple. Therefore the 'byte-range support' must be enabled on the server on which they are hosted: https://discussions.apple.com/thread/4119538?page=2

Because of the number of complaints there have been of iPhones not being able to play some podcasts, Apple now require the server you host your media files on to have 'byte-range support' enabled - basically this means coping with requests for only part of a file at a time, which is required for the iPhone. You should confirm with your hosting service that they support this: if they don't (or don't know what it is) you should find another hosting service.

Also if you are using Cloudflare as a CDN service, and gzip compression is enabled on the server the 'Accept-Ranges' header is not forwarded by Cloudflare and the videos are not properly served: https://community.cloudflare.com/t/accept-ranges-and-content-length-headers-not-forwarded-by-cloudflare/41445/4

Therefore there are two solutions:

  1. Completely disable gzip compression on the server.
  2. Enable gzip compression on the server and add SetEnvIfNoCase Request_URI \.mp4$ no-gzip dont-vary## Heading ## to the .htaccess file so as not to compress .mp4 files. The solution is applicable for any video format.
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda