lightbox: Offer to open browser if video player doesn't support a video format #1208
Labels
a-lightbox
The lightbox / image-viewer screen
beta feedback
Things beta users have specifically asked for
Milestone
Sometimes the video player fails to initialize because the video format isn't supported:
The app relies on the platform's (iOS or Android) set of implementations for playing videos of various formats. Sometimes the platform doesn't support a video but the user's browser does because the browser brings its own implementation. For example, it fails in the app for me on iOS 18.1.1 but succeeds in Chrome on the same device. See discussion in beta feedback.
So, when a video is unsupported, it would be helpful to offer to open it in the browser.
Implementation notes:
Here's the note from the library we use,
video_player
:https://github.com/flutter/packages/tree/311b660c6/packages/video_player/video_player
The error I get on iOS is a
PlatformException
; here's what went by in the logs:Looks like the structured "code" part is just a generic "VideoError", and the part that says it's specifically a format issue is this string:
Rather than parsing that, let's try just assuming a "VideoError"—or perhaps any error—is a good reason to offer to open the browser, and do so.
If the video is on-realm, needing authentication, we should use the "temp file URL" protocol; see
api.tryGetFileTemporaryUrl
in zulip-mobile.The text was updated successfully, but these errors were encountered: