Skip to content

Do not auto-play videos. #3978

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

Merged
merged 1 commit into from
Dec 2, 2024
Merged

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Dec 2, 2024

Following what has been done on iOS and avoiding user to get loud audio when clicking on a video in the timeline, the application will not auto play video when open in full screen.

@bmarty bmarty requested a review from a team as a code owner December 2, 2024 13:48
@bmarty bmarty requested review from ganfra and removed request for a team December 2, 2024 13:48
@@ -238,7 +235,8 @@ private fun ExoPlayerMediaVideoView(

OnLifecycleEvent { _, event ->
when (event) {
Lifecycle.Event.ON_RESUME -> exoPlayer.play()
Lifecycle.Event.ON_CREATE -> exoPlayer.addListener(playerListener)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How it wasn't necessary before?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the addListener, I feel better with having the parity onCreate/onDestroy.
For the prepare, if I do not call it onResume, we get on black screen when putting the app in bg then in fg, not sure why.

All is working fine when testing the player with this code.

Copy link
Member

@ganfra ganfra Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AddListener and dispose is not exactly parity I'd say?
But are we not already adding this listener somewhere else? that was my question

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The listener was set in a LaunchedEffect block (previous version line 132, see the diff)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I didn't see it!

Copy link
Contributor

github-actions bot commented Dec 2, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/htbJiU

Copy link

sonarqubecloud bot commented Dec 2, 2024

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 37.50000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 83.08%. Comparing base (b73884c) to head (1ee8676).
Report is 17 commits behind head on develop.

Files with missing lines Patch % Lines
...ies/mediaviewer/impl/local/video/MediaVideoView.kt 37.50% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3978      +/-   ##
===========================================
+ Coverage    83.03%   83.08%   +0.04%     
===========================================
  Files         1796     1805       +9     
  Lines        45600    45638      +38     
  Branches      5375     5380       +5     
===========================================
+ Hits         37864    37918      +54     
+ Misses        5855     5833      -22     
- Partials      1881     1887       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmarty bmarty merged commit 4bb6c24 into develop Dec 2, 2024
26 of 27 checks passed
@bmarty bmarty deleted the feature/bma/disableVideoAutoPlay branch December 2, 2024 16:40
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.

2 participants