Search…

X3 Photo Gallery Support Forums

Search…
 
foxyphoto
Topic Author
Posts: 5
Joined: 18 Mar 2021, 13:40

Streaming videos on iOS

19 Mar 2021, 06:35

Streaming videos is not working on iOS devices but it‘s working in every other browser (even Safari on Mac).

Media files for iOS must support byte-range requests otherwise playback won‘t work. Also it requires the servers to support „Accept Range=bytes“, but this is usually the case in standard configurations.

To get this work, you will need to handle byte-range requests in the script ($_SERVER['HTTP_RANGE' ) because iOS devices are using HTTP byte-ranges for requesting audio and video files.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Streaming videos on iOS

19 Mar 2021, 11:17

Do you have an example? Files app does not serve the actual video ... It's just loaded into <video> tag like any other video on the web. If it doesn't work on iOS, then this seems like a compatibility or codec issue to me. How would Files app serve "$_SERVER['HTTP_RANGE' ]" for the video? Can you load this video into another (any) web page? Perhaps your server is not serving all the correct headers for video files?

This request doesn't seem logical.
 
foxyphoto
Topic Author
Posts: 5
Joined: 18 Mar 2021, 13:40

Re: Streaming videos on iOS

19 Mar 2021, 16:21

You‘re right, it‘s apparently not a serving issue but a request problem. I have a standard .mp4 which can be played on iOS devices without problems if accessed on the server directly, so no format issue here.

In Files in iOS Safari, the play-button is broken.

Consulting Apple‘s Developer page:
HTTP servers hosting media files for iOS must support byte-range requests, which iOS uses to perform random access in media playback. (Byte-range support is also known as content-range or partial-range support.) Most, but not all, HTTP 1.1 servers already support byte-range requests.
Checking the server with curl replies with
Response Headers
Accept-Ranges:bytes
Content-Length:42563120
Content-Type:video/mp4;charset=UTF-8
and even the Apache configuration says that byte-range is supported. Also it works perfectly when using any browser on any other system.

So basically Safari iOS is making an initial request like expected, but then requests subsequent chunks using the Range header. Maybe a header to accept range has to be sent.

I checked various iOS devices, all the same. Has someone successfully streamed video in Files on any iOS device?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Streaming videos on iOS

20 Mar 2021, 03:10

You need to provide a link to the file or at least upload the video somewhere I can test it. MP4 files will play nicely from iOS, as long as the codec is supported. You can see working mp4 files in our demo:
https://demo.files.gallery/?samples/video

When Files app (or any website) loads a video, the HTML code looks like this:
Code
<video src="path/to/file.mp4" type="video/mp4">
It's up to the browser to play the video, and the server to serve the file, and Files app will not intervene as that would not make any sense. If it doesn't work, then either the mime type (video/mp4) is not correct, or iOS simply does not support your video. I can only diagnose further if you can offer a link to the video, or upload it somewhere so I can test it. iOS definitely supports normal mp4 files, as you can see in the demo. However, it has limited "codec" support, and does not support all the same codecs as desktop browsers ... "mp4" format is just the container, but codecs can be different.
 
foxyphoto
Topic Author
Posts: 5
Joined: 18 Mar 2021, 13:40

Re: Streaming videos on iOS

20 Mar 2021, 06:31

I just checked with the sample files from your demo and playback is still broken.
I will try an alternative server to see where this issue is coming from, apparently it‘s a host issue and no client issue.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Streaming videos on iOS

20 Mar 2021, 08:17

The MP4 videos definitely work as they should on my iPhone. The "webm" and "ogv" formats will not play on iOS, because they are not supported.
Image
 
foxyphoto
Topic Author
Posts: 5
Joined: 18 Mar 2021, 13:40

Re: Streaming videos on iOS

20 Mar 2021, 15:42

Okay, figured out what the problem was:
as soon as the root-path was changed to a top-level folder, images were still working fine but videos on iOS were broken. Android and desktop computers were able to handle this. When changing root to a subfolder (or the same folder when left blank), it‘s working.
I can‘t figure out why changing to a top-level folder let the server break the byte range option on iOS, but at least it‘s working now.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Streaming videos on iOS

21 Mar 2021, 00:41

Strange! Glad you figured it out at least.