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

[Video] Mute behaviour & autoplay disabled improvements #5295

Closed
wants to merge 2 commits into from

Conversation

mozzius
Copy link
Member

@mozzius mozzius commented Sep 12, 2024

This PR does three things (all native)

  1. Persists mute state (in feed) between videos
  2. Makes sure videos are unmuted initially when autoplay is disabled
  3. Adds a play/pause button when autoplay is disabled

The rationale behind change # 3 is that when autoplay is disabled, it acts a bit more like a traditional video player and thus would be nice to be able to make it stop playing

Screenshot 2024-09-12 at 12 15 15

Test plan

Test all 3 changes individually. Make sure with autoplay enabled, there are no regressions other than the the persisted mute state change

@arcalinea arcalinea temporarily deployed to samuel/autoplay-disabled-improvements - social-app PR #5295 September 12, 2024 11:23 — with Render Destroyed
Comment on lines +108 to +116
useEffect(() => {
function listener(newIsPlaying: boolean) {
setIsPlaying(newIsPlaying)
}
player.addListener('playingChange', listener)
return () => {
player.removeListener('playingChange', listener)
}
}, [player])
Copy link
Member Author

Choose a reason for hiding this comment

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

We've had issues with player in useeffects before, is this one ok?

Copy link
Contributor

Choose a reason for hiding this comment

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

Screenshot 2024-09-12 at 3 30 40 PM

🥳 (can update this after merging my fix or vice versa, but this effect should be okay in general from what i saw before...)

Copy link

Old size New size Diff
7.13 MB 7.13 MB 128 B (0.00%)

@mozzius mozzius requested a review from haileyok September 12, 2024 15:41
@prohr
Copy link

prohr commented Sep 12, 2024

With these changes, will the play state (active vs. paused, muted vs. noisy) persist when toggling back + forth between the feed preview + the fullscreen video player?

As shipped, 1.91 exhibits the following behavior:

  1. Video starts off disabled + muted (due to pref setting)
  2. Click into player, starts going
  3. Click to add sound, starts making noise
  4. Pause/stop within player
  5. Click to exit

Actual behavior:

  1. Video preview is muted (?), but keeps playing (??)

Expected behavior:

  1. Video preview in feed is paused

@mozzius
Copy link
Member Author

mozzius commented Sep 12, 2024

Yeah it should be much more sane with autoplay disabled, will act more like web desktop

@haileyok
Copy link
Contributor

okay lets try to get this into my pr...

@haileyok
Copy link
Contributor

Merged in through rebases

@haileyok haileyok closed this Sep 13, 2024
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.

4 participants