Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: black screen in ExoPlayer on rotate #86

Open
wants to merge 1 commit into
base: 2U/develop
Choose a base branch
from

Conversation

k1rill
Copy link
Collaborator

@k1rill k1rill commented Jan 21, 2025

Workaround with VideoPlayer flow on configuration changes.

What was done:

  1. Shared EncodedVideoUnitViewModel between VideoUnitFragment and VideoFullScreenFragment and storing exoPlayer instance in it.
  2. VideoFullScreenFragment became DialogFragment to have access to the shared viewModel
  3. VideoFullScreenFragment moved to Compose

Known problem: subtitles not working in fullscreen

@k1rill k1rill changed the title fix: black screen on exoplayer on rotate fix: black screen in ExoPlayer on rotate Jan 21, 2025
@HamzaIsrar12
Copy link

I conducted a manual review on the emulator last week, where things still felt quite laggy. However, I tested it again on my own device today, and the experience was much improved. The lag decreased from 5–6 seconds to 1–2 seconds. Great job on that!

I did notice two issues from a learner's perspective:

  • Rotating the phone to change orientation in fullscreen causes the video to pause, which shouldn’t happen.
  • The on-player captions aren’t working at all. (For clarity, I’ll refer to the on-player captions as subtitles and the captions below the player as transcription.)

Note: @omerhabib26 is performing an in-depth review.

@omerhabib26
Copy link

Hey @k1rill, great job on the revamp! The lag has dropped to just 1-2 seconds, which is a big improvement. However, there are still a couple of issues that need attention:

  • When the device is in portrait mode and the user taps on the fullscreen button, the player switches to fullscreen, but the video size doesn’t adjust—it stays in portrait orientation. Ideally, the player should expand to full-screen size and switch to landscape mode. A good example of this behavior is the YouTube app.

  • When the device is in portrait mode and the user rotates it, a white gap appears at the bottom of the screen, covering the player’s bottom options.

Screen_Recording_20250127-181703_edX.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants