Can't access video file stored in "media" on Safari

You can create a file::url() component that delivers video files from the content folder if you can’t find out what might be wrong on the server.

Thank you for digging deeper @texnixe and @manuelmoreale. I’m checking with my server provider now, but tbh I don’t think its a problem from their side as well. I requested exactly the same video with Kirby 2 before and that always worked…

Could you post your .htaccess, please? Is that project on shared hosting? Which provider?

As I said, your exact same video, on a kirby 3 installation, works just fine in safari. So it’s most likely a combination of Kirby and your specific server setup.

Here’s my .htaccess file. It’s basically the one from the starterkit with some additions to force https, www and removing of trailing slashes.

# Kirby .htaccess

# rewrite rules
<IfModule mod_rewrite.c>

# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

# Remove multiple slashes after domain
RewriteCond %{HTTP_HOST} !=""
RewriteCond %{THE_REQUEST} ^[A-Z]+\s//+(.*)\sHTTP/[0-9.]+$ [OR]
RewriteCond %{THE_REQUEST} ^[A-Z]+\s(.*/)/+\sHTTP/[0-9.]+$
RewriteRule .* https://www.%{HTTP_HOST}/%1 [R=301,L]

# Remove multiple slashes anywhere in URL
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]

# make sure to set the RewriteBase correctly
# if you are running the site in a subfolder.
# Otherwise links or the entire site will break.
#
# If your homepage is http://yourdomain.com/mysite
# Set the RewriteBase to:
#
# RewriteBase /mysite

# In some environments it's necessary to
# set the RewriteBase to:
#
# RewriteBase /

# block files and folders beginning with a dot, such as .git
# except for the .well-known folder, which is used for Let's Encrypt and security.txt
RewriteRule (^|/)\.(?!well-known\/) index.php [L]

# block text files in the content folder from being accessed directly
RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L]

# block all files in the site folder from being accessed directly
# except for requests to plugin assets files
RewriteRule ^site/(.*) index.php [L]

# Enable authentication header
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

# block direct access to kirby and the panel sources
RewriteRule ^kirby/(.*) index.php [L]

# make site links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

</IfModule>

# compress text file responses
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>

and it’s on a shared swiss provider called cyon.

Any chance you can send my a zip with your site? I also use MAMP and what i tested worked just fine so maybe it’s something else that’s messing the video. I’m happy to give it a check if you want.

Alternatively, set up a fresh Starterkit on that same server/your Mamp environment with that video. No plugins, no Javascript…

I think your missing Accept-Ranges header is causing this. Try to put a .htaccess file into the media folder with the only content:

Header set Accept-Ranges “bytes”

and check afterwards (with wget -S or similar tools) if the header is now there and set to bytes, then check your video.

We are currently trying to debug this, it seems to be an issue with the multi-site setup, not the server side of things.

Forgive me if I sound off-topic, because I don’t understand some of the things in this thread.
I had the same issue that a video did not load in safari only, safari said “fail to load” in the console. It was resolved after I removed “position: fixed” from the video.

how was this issue solved? im having this same issue with Safari not showing the video from the Media folder.

If I upload the same video manually to the Media folder it works, so it seems to be something to do with how the video is copied to the Media folder?

The first step you could do is compare the files in the content folder and the file in the media folder when copied by Kirby to check if they are 100% identical. There are different ways to do that, i.e on Mac/Linux you can do

sha256sum video1.mp4 video2.mp4

Please indicate which Kirby version you are using.

Thanks I’ll try that. Using Kirby 5.2.1.