Offline MP4 video fails with "Sorry" error — incorrectly opened via PreviewImageActivity instead of video player
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 领域
- mobile-dev
调研方向
从 FileDisplayActivity 中的离线文件处理开始,跟踪点击文件时已完成的下载是如何被路由的。将 PreviewImageActivity/PreviewImageFragment 路径与初始化 ExoPlayer 的流式传输路径进行比较,然后使用离线 MP4 重现问题。完成的标准是离线 MP4 能够在视频播放器中打开,且不会出现位图加载错误。
由索引模型根据 Issue 内容生成。
描述
⚠️ 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.
- 主要语言
- Kotlin
- 星标
- 5.7k
- 派生
- 2.1k
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 135
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nextcloud/android 的其他 Issue
-
0. Needs triage bug
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 86/100
nextcloud/android#17845 · 2 条评论 ·
维护者通常 1 天内回复
-
[Bug] Lock owned by another client (e.g. Text app) cannot be unlocked from the app可能已有人在做 @falkloewert 于 28 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
nextcloud/android#17837 · 2 个 reaction ·
维护者通常 1 天内回复
-
0. Needs triage
难度 2/5 1-3 小时 新手友好度 84/100
nextcloud/android#17533 · 1 条评论 ·
维护者通常 1 天内回复
-
RC 34.1.0-01: Duplicated wording in creation menu — "New" prefix + creator name produces "New New document" ("Neu Neues Dokument")可能已有人在做 @ChristianTannheimer 于 118 天前认领。 未关闭0. Needs triage bug
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
查看 nextcloud/android 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
Kotlin/kotlin-lsp#309 ·
-
area:data-quality importer size:S
难度 2/5 1-3 小时 新手友好度 72/100
enorm-labs/event-junkie#5136 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
Type: Possible bug
难度 2/5 1-3 小时 新手友好度 68/100
spacecowboy/Feeder#1318 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
wangzan101/Mika#644 ·
维护者通常 1 天内回复