Streaming video when using "Key type: user key" encryption don't work if media is not shared.
- Dominant language
- Kotlin
- Stars
- 5.6k
- Forks
- 2k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 92
Description
### ⚠️ Before posting ⚠️
- [x] This is a **bug**, not a question or an enhancement.
- [x] I've [searched for similar issues](https://github.com/nextcloud/android/issues) and didn't find a duplicate.
- [x] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- [x] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/).
### Steps to reproduce
1. Enable Per User encryption on server.
2. Try to stream any mp4 by tapping on it in nextcloud app, or use the 3 dots and select stream.
### Expected behaviour
The file should start buffering and stream
### Actual behaviour
You get an error with "can't read media file". And a log entry on server that the file can't be decrypted.
### Android version
14
### Device brand and model
Xperia 1V
### Stock or custom OS?
Stock
### Nextcloud android app version
3.30.6
### Nextcloud server version
30.0.4
### Using a reverse proxy?
Yes
### Android logs
_No response_
### Server error logs
```bash
{"reqId":"A6YsLBJh5FFilUiRmD5B","level":3,"time":"2024-12-25T23:06:30+00:00","remoteAddr":"_hidden_","user":"--","app":"no app in context","method":"GET","url":"/remote.php/direct/9KxmcOiIpnCDPFn8r0vWu5XW3oYLui2eYdtykhVjWnqIlXylIJQRTPivlHph","message":"Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.30.6","version":"30.0.4.1","data":[],"id":"676c90e388c6d"}
```
### Additional information
It looks like the app tries to get a direct link to the file in question and this direct link can not decrypt the file. Same result if i e.g. try to stream it to MX Player.
A workaround i found is if i first share the file with a public link, then it works, i can both play it in nextcloud app, and stream to MX Player. But if i remove the public link, it fails again to decrypt the file.
So i guess the app creates some kind of temporary link that can't decrypt the file. And i don't now if this is a feature of the Nextcloud server, and the error is on that side, or if it is the app.
Streaming from Web UI works fine.
Contributor guide
Assessment
This issue has not been assessed yet.