Video playback not working on Safari (MacOS and iOS)

Hi,
I can’t play videos using MacOS and iOS using Safari.
Nextcloud is installed on a Raspberry APIs 4B 8GB running Buster. I’m using nginx as Webserver. Pictures are working well and preview images for videos are working as well. Just the playback doesn’t work using Safari. It does work on MS Edge and Firefox on Windows and Linux.

Nextcloud version (eg, 20.0.5): 22.1.1
Operating system and version (eg, Ubuntu 20.04): MacOS 11.5.2, iOS 14.4.1, 14.7.1, 14.3
Apache or nginx version (eg, Apache 2.4.25): nginx 1.14.2
PHP version (eg, 7.4): 7.4

The issue you are facing:

Videos won’t play using Safari and latest NC iOS app. Tried mp4, mov and avi. The mov files were recorded by my iPhone 12.
“Error loading FILENAME.mp4/mov/a I” comes up.

Is this the first time you’ve seen this error? (Y/N): No

Steps to replicate it:

  1. Play videos on those devices

The output of your Nextcloud log in Admin > Logging:

No errors or other logs

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):


<?php
$CONFIG = array (
  'instanceid' => 'xx',
  'passwordsalt' => 'xx',
  'secret' => 'xx',
  'trusted_domains' => 
  array (
    0 => 'xx.de',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '22.1.1.2',
  'overwrite.cli.url' => 'https://xx.de',
  'dbname' => 'xx',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xx',
  'dbpassword' => 'xx',
  'installed' => true,
  'theme' => '',
  'loglevel' => 2,
  'maintenance' => false,
  'overwriteprotocol' => 'https',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'default_phone_region' => 'DE',
  'updater.secret' => '$2y$10$.xxx',
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\TXT',
    1 => 'OC\\Preview\\MarkDown',
    2 => 'OC\\Preview\\OpenDocument',
    3 => 'OC\\Preview\\PDF',
    4 => 'OC\\Preview\\MSOffice2003',
    5 => 'OC\\Preview\\MSOfficeDoc',
    6 => 'OC\\Preview\\Image',
    7 => 'OC\\Preview\\Photoshop',
    8 => 'OC\\Preview\\TIFF',
    9 => 'OC\\Preview\\SVG',
   10 => 'OC\\Preview\\Font',
   11 => 'OC\\Preview\\MP3',
   12 => 'OC\\Preview\\Movie',
   13 => 'OC\\Preview\\MKV',
   14 => 'OC\\Preview\\MP4',
   15 => 'OC\\Preview\\AVI',
 )
);

The output of your Apache/nginx/system log in /var/log/____:


2021/09/04 07:16:09 [error] 733#733: *16261 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 149.224.136.244, server: xxx.de, request: "GET /core/preview?fileId=138510&c=26dec64549b05bc2896b4d4025ee6645&x=500&y=500&forceIcon=0&a=0 HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock", host: "xxx.de", referrer: "https://xxx.de/apps/files/?dir=/Photos&fileid=10"
(Example, all files have the same output)

It does work on MS Edge on MacOS and Windows, also on Firefox and Opera on Ubuntu 21.04.