Error loading a resource in Safari for the first time

Hi!

Videos are not loading on Safari on the first load. It works on Firefox and Chrome. When I am refreshing Safari it works. Even when I’m emptying my caches or remove website data it still works.

It also kind of works together with different devices. When I’ve started on my Mac it works on my iPhone immediately.

A simple example: https://larais.online/test2/test

First load:

first load

Refresh:

A few files (not all) are showing these errors on first load:


I have been trying around a lot and have no idea about what’s going on. :slight_smile:

Hello,

I’ve just checked the URL in Safari, Safari Technology Preview & Safari (iOS) and the video works on first load. Could this be a local issue?

Thanks for checking! I just tried it a few more times and apparently it is the very first time opening the website on Safari. No matter who it is. I created a new link without opening it – maybe you could check it again?

https://larais.online/forum1/test

(In case someone else already clicked the link, I also added forum2, forum3 and forum4)

No problem :slight_smile:

Just checked again with the new link you posted and can confirm (as previously) that the video plays the very first time when opened in Safari, Safari TP & iOS.

I’ve cleared all cached browser data and retried and (again) the video opens and plays on the very first load each time. I’ve re-tested the video in your OP and additional videos (forum1, 2, 3 & 4) and all play without issue on first load.

For me, your first link played the first time in safari, but when I opened the second link, it didn’t and I had to reload.

Thanks for trying again, @aoimedia
Really strange that it works for you as the first person opening the site but not for me on different devices/networks :frowning:

Also thanks @texnixe .
Do you have any idea why this is happening? And why it’s just happening to the videos and NOT to the photos? I created a few new copies …

https://larais.online/forum11/test
https://larais.online/forum12/test
https://larais.online/forum13/test
https://larais.online/forum14/test

It also happens when I’m starting it locally with MAMP. The first visit doesn’t load the videos.

You’re welcome @wat :slight_smile:

Update: I’ve just tried reloading the videos and like @texnixe the first video (forum11) loads and plays without issue. However, the second video (forum12) does not. I have to refresh before it displays/plays.

However, Safari TP still plays all videos.

I appreciate this probably isn’t helping very much (sorry) but perhaps it does prove there is an (intermittent?) issue.

Related?

MacOS Safari v15.3 (Monterey) not playing h.264/mp4 video

Hmm, the strange thing is that it loads with the first refresh and the problem “disappears” (for everyone). However, when I’m renaming the very same folder the problem appears again.

I can also open the files before opening the site the first time.

→ works on first load: https://larais.online/forum20/media/pages/test/d4f43ab9a1-1684832920/metascenario.mp4

→ opening website afterwards:

→ media not included:

→ after first load they appear at the page and after second load they’re also shown in the media folder

I just exported the page and uploaded it as a static page. There is no problem at all, not even at the first click.

https://larais.online/export/export.html

Oh, new findings. This doesn’t show the video:

<div class="project-cover" id="cover">

  <video autoplay loop muted playsinline>
    <?php if ($video = $page->videomp4()->toFile()): ?>
      <source src="<?= $video->url() ?>" type="video/mp4">
    <?php endif ?>

    <?php if ($video = $page->videowebm()->toFile()): ?>
      <source src="<?= $video->url() ?>" type="video/webm">
    <?php endif ?>

    Sorry, your browser doesn’t support embedded videos. :(
  </video>

</div>

However, changing

src="<?= $video->url() ?>"

to a link

src="https://larais.online/cleaning3/media/pages/test/90521715e1-1684832923/intro.mp4"

immediately displays the video. :eyes: