pitr / gemini-ios

Elaho - iOS browser for Gemini protocol
Mozilla Public License 2.0
116 stars 6 forks source link

Handle binary files not supported by iOS #18

Closed szczja closed 3 years ago

szczja commented 3 years ago

I’ve approached on the gemini://chriswere.uk/trendytalk/ link with binary content which is opened as text. As I have read in Gemini protocol specification the response could be binary one. I don’t know if it problem with Elaho or server.

pitr commented 3 years ago

Thank you for reporting this. Elaho leaves up to iOS how to present binary files (PDF/MP3/etc). Unfortunately iOS doesn't support OGG format. For example, opening this - https://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg - in Mobile Safari would only provide a Download option. iOS just displays the raw file for formats it does not support, hence

There are libraries that can be used, eg provided in this SO question, but I am split here as there are two options:

  1. Add an audio library to support playing OGG format. This keeps user experience optimal. But this is a slippery slope, what about other unsupported audio formats, video formats, Word documents, etc.
  2. The other option is to keep it simple. Elaho is not an audio/video player, it's a gemini browser. This is the reason for instance why I didn't add support for gopher (there is an app for that already). Fix Elaho to download the file into iOS Files, let the user choose how they consume that file. The problem is that this is not always super obvious. Coming back to Ogg example, now the user needs to jump through hoops to play that file.

I am leaning towards keeping Elaho as simple as Gemini protocol itself, not overloading it with things that web browsers have like plugins, Flash players, user profiles, etc. In fact, in Trendy Talk episode 2021-02-15 - Gemini, the broken web and Nertz around minute 22 they specifically talk about how great it is that an (unspecified) gemini browser would open Ogg files in your music player instead of playing it itself, and their disdain for web players.

szczja commented 3 years ago

Ok, I’m understand that Elaho won’t have build in music libraries for OGG. I’m writing about that this binary content is opened inside text window. There are no download option in Elaho as in Safari.

What is more that podcast page doesn’t have any visible description that this is a link to binary content and Elaho working for a while reading this binary-text content. I was thinking that Elaho crashed at the first time.

pitr commented 3 years ago

I should have been more clear in my post. Yes, current implementation is indeed broken (for at least OGG files). I was jumping towards deciding how to fix it. Tagged as bug.

szczja commented 3 years ago

Ok, now it’s clear. Thanks for your work.

pitr commented 3 years ago

v1.4 was released into App Store with this fix