Video preview: use fullscreen dialog for video instead of new activity#11089
Video preview: use fullscreen dialog for video instead of new activity#11089AlvaroBrey merged 5 commits intomasterfrom
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #11089 +/- ##
============================================
+ Coverage 30.87% 31.43% +0.55%
- Complexity 3280 3320 +40
============================================
Files 564 564
Lines 41616 41618 +2
Branches 5657 5638 -19
============================================
+ Hits 12849 13082 +233
+ Misses 26833 26547 -286
- Partials 1934 1989 +55
|
This looks like a pre-existing bug that just shows here easier. The video that shows the problem is stored in horizontal but has a rotation metadata. There was a bug in Android with this, but it was patched in Android 11 (API 30). Reference: google/ExoPlayer#1482 There are other bugs with SurfaceView and metadata rotation, and workarounds with TextureView. In the master branch and previous releases, this is reproducible by:
It looks like the bug is only triggered when the video is "resumed" on a surface, either a new one or the same one it was already on. I can reproduce this in api 29 and lower, but can't reproduce in a higher API level. I can also only reproduce it with the 29 - Google Play image, not with the 29 - google APIs one. Fix may have been backported? There may be a possible (but fairly complicated) workaround by using TextureView and applying the rotation manually. This would have to be confined to android <=29, as TextureView is more battery-consuming than the default SurfaceView. @tobiasKaminsky what do you think we should do here? Attempt the workaround for API <29, or just let it be? It only happens with some <=29 devices, and only with videos with metadata rotation. |
|
First, great that you figured it out!
Actually I have no idea either. <=29 is quite a lot of users, which might be not a problem, depending how many videos actually use this rotation info.
How long would this roughly take? Then we could first merge without above workaround, but when to many users suffer by it, we can use this workaround or revert. Another option would be to have this only for >29 enabled, and once we drop 28 support, we can change it. |
|
Another workaround idea: in devices with api <= 29, keep using the old approach (new exoplayer rather than transferring the old one). This will invalidate the UX gains for api 29 and under, though. |
I have no idea :( I think the workaround in my previous comment may be preferrable |
|
Rotation bug worked around in 4fc73f0 |
|
/rebase |
This allows transfering the playback directly between Player views, thus avoiding creating a new ExoPlayer, re-starting the stream, having to pass playing status/current position, etc. Additionally: - Always enable buffering animation so it's clear when a video is loading - Add padding to fullscreen duration numbers so they don't get cut off on rounded screens Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
…pause the video while transfer is happening Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
See comments in added code for explanation Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
4fc73f0 to
3f990c3
Compare
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/11089.apk |
|
Works perfectly fine with "broken" video. |


This allows transfering the playback directly between Player views, thus avoiding creating
a new ExoPlayer, re-loading the stream, having to pass playing status/current position, etc.
In summary, this provides a much more seamless experience when switching to/from fullscreen.
Additionally: