android
android copied to clipboard
Refactor ExoPlayer
The code we use for the video preview is a bit cluttered. So I'd like to propose to refactor it. Here are some suggestions we should apply:
- The Player view is split up into a PreviewVideoActivity, which is used for full screen playback, and a PreviewVideoFragment which is used for embedded playback. Both share the same code which is redundant and requires communication between both. I suggest to remove the
PreviewVideoActivityand try to make the fragment be shown in fullscreen mode if possible. - PreviewVideoActivity and PreviewVideoFragment both implement a couple of listeners. This bloats the code size of them both. I'd suggest to "pull" the listener parts out of these classes and make them independent from it.
- Update to Kotlin. Because while doing that modernizing the code would be a good idea.
I'd also propose to do this before redesigning the player. This way we can make sure our next steps are build on solid ground.
Will need research before.