Offline MP4 video fails with "Sorry" error — incorrectly opened via PreviewImageActivity instead of video player
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 68/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Domaine
- mobile-dev
Piste de recherche
Commencez par la gestion des fichiers hors ligne dans FileDisplayActivity et suivez la manière dont un téléchargement terminé est routé lorsque le fichier est touché. Comparez le chemin PreviewImageActivity/PreviewImageFragment avec le chemin de streaming qui initialise ExoPlayer, puis reproduisez le problème avec un MP4 hors ligne. Le travail est terminé lorsque le MP4 hors ligne s’ouvre dans le lecteur vidéo sans l’erreur de chargement du bitmap.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
⚠️ Before posting ⚠️
- This is a bug, not a question or an enhancement.
- I've searched for similar issues and didn't find a duplicate.
- I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- I agree to follow Nextcloud's Code of Conduct.
Steps to reproduce
- Upload an MP4 video file to Nextcloud (e.g. in a folder that also contains photos).
- In the Android app, open the file and confirm it plays correctly via streaming (file not marked as offline).
- In the file's options menu, enable "Available offline".
- Wait for the download/sync to fully complete (offline icon appears on the file).
- Tap the file to play it.
Expected behaviour
The video should play normally using the app's video player, the same as it does when streamed.
Actual behaviour
The video player fails to open. Instead, the app shows a "Sorry" error screen. Disabling "Available offline" (removing the local copy) and playing the same file via streaming works without issue. Re-enabling "Available offline" reproduces the failure consistently.
adb logcat captured during the failure shows the app launching com.owncloud.android.ui.preview.PreviewImageActivity (the image preview screen) for the offline MP4 file, instead of the video player activity:
E PreviewImageFragment: File could not be loaded as a bitmap: /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/[account]/[folder path]/20260802_164950.mp4
The file is being routed to the image-preview component, which fails to decode it as a bitmap since it's a video — producing the "Sorry" error. When the same file is streamed directly from the server (not offline), it is correctly opened via the video player (AndroidXMedia3/ExoPlayer), confirmed by log lines such as:
I ExoPlayerImpl: Init [...] [AndroidXMedia3/1.10.1] [...]
This suggests the local (offline-cached) copy of the file is not being correctly identified as a video by MIME type / file-type detection, and the app falls back to (or incorrectly selects) the image preview pathway instead of the video player, only for locally cached files.
Android version
16
Device brand and model
Samsung Galaxy S24 Ultra
Stock or custom OS?
Stock
Nextcloud android app version
34.1.0
Nextcloud server version
34.0.2
Using a reverse proxy?
Yes
Android logs
--- Sanitized adb logcat excerpt (account/domain and personal file path redacted) ---
08-05 18:56:07.344 12983 12983 D FileDisplayActivity: file download completed received
08-05 18:56:07.347 12983 12983 D FileDisplayActivity: updating ui for file download
[user taps the downloaded MP4 file]
08-05 18:56:08.610 2998 7323 D ActivityTaskManager: startActivityAsUser: callingPid=12983, callingUid=10061
08-05 18:56:08.621 2998 7323 I ActivityTaskManager: START u0 {xflg=0x4 cmp=com.nextcloud.client/com.owncloud.android.ui.preview.PreviewImageActivity (has extras)} with LAUNCH_MULTIPLE from uid 10061 (com.nextcloud.client) result code=0
08-05 18:56:08.637 12983 12983 D PreviewImageActivity: onCreate(Bundle) starting
08-05 18:56:08.660 12983 12983 D PreviewImageActivity: onStart() starting
08-05 18:56:08.666 12983 12983 D PreviewImageActivity: onResume() starting
08-05 18:56:08.687 12983 12983 D PreviewImageFragment: savedInstanceState is null
08-05 18:56:08.694 12983 7060 E PreviewImageFragment: File could not be loaded as a bitmap: /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/[account]@[domain]/[folder path]/20260802_164950.mp4
08-05 18:56:08.702 2998 3185 I ActivityTaskManager: Displayed com.nextcloud.client/com.owncloud.android.ui.preview.PreviewImageActivity for user 0: +88ms
--- End of excerpt ---
Server error logs
Additional information
Key observation: Immediately after the offline download completes (FileDisplayActivity: "file download completed received"),
tapping the file directly launches PreviewImageActivity (the image preview screen) rather than any video player activity.
No video/MIME-type detection or routing to a video player activity is visible in the log at any point in this sequence.
The activity attempts to decode the MP4 as a bitmap and fails, producing the "Sorry" error shown to the user.
For comparison, streaming the same file (not offline) correctly initializes ExoPlayer (AndroidXMedia3) instead of
PreviewImageActivity.
- Langage dominant
- Kotlin
- Étoiles
- 5.7k
- Forks
- 2.1k
- Merge moyen
- 1 j 22 h
- PR mergées (30 j)
- 135
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de nextcloud/android
-
0. Needs triage bug
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 86/100
nextcloud/android#17845 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug] Lock owned by another client (e.g. Text app) cannot be unlocked from the appPeut-être pris @falkloewert l’a pris il y a 28 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
nextcloud/android#17837 · 2 réactions ·
Les mainteneurs répondent en général sous 1 jour
-
0. Needs triage
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
nextcloud/android#17533 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
RC 34.1.0-01: Duplicated wording in creation menu — "New" prefix + creator name produces "New New document" ("Neu Neues Dokument")Peut-être pris @ChristianTannheimer l’a pris il y a 118 jours. Ouverte0. Needs triage bug
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de nextcloud/android
Issues similaires
-
Failures in nested test classes (Outer$Inner) are not annotated on their source filePeut-être pris @NopeCharon l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
mikepenz/action-junit-report#1661 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Kotlin/kotlin-lsp#309 ·
-
Two stored artist rows are not act names: "DJS" from a Renate floor heading and "Stevie Cox -"Ouvertearea:data-quality importer size:S
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
enorm-labs/event-junkie#5136 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
Les mainteneurs répondent en général sous 1 jour
-
Type: Possible bug
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
spacecowboy/Feeder#1318 ·
Les mainteneurs répondent en général sous 1 jour