Conversation
b4776b5 to
2c91dcf
Compare
140860a to
f98f9da
Compare
|
|
||
| if (prevIsMutedRef.current && prevVolumeRef.current === 0 && !status.isMuted) { | ||
| updateVolume(0.25); | ||
| if (prevIsMuted.get() && volume.get() === 0 && !status.isMuted) { |
There was a problem hiding this comment.
At first I thought I would be able to get rid of this part completely, however, in the full-screen mode mute states are not properly initialized on first startup, this fixes these lines now
34a46c8 to
bb836ca
Compare
| const isUploading = CONST.ATTACHMENT_LOCAL_URL_PREFIX.some((prefix) => url.startsWith(prefix)); | ||
| const videoStateRef = useRef<AVPlaybackStatus | null>(null); | ||
| const {updateVolume} = useVolumeContext(); | ||
| const {updateVolume, lastNonZeroVolume, volume} = useVolumeContext(); |
There was a problem hiding this comment.
Eslint is failing here
| currentVideoPlayerRef.current.setStatusAsync({volume: newVolume, isMuted: newVolume === 0}); | ||
| currentVideoPlayerRef.current.setStatusAsync({ | ||
| volume: newVolume, | ||
| isMuted: newVolume === 0, | ||
| }); |
There was a problem hiding this comment.
Nothing was changed here, right? Let's revert
| }, | ||
| [currentVideoPlayerRef, volume], | ||
| ); | ||
|
|
There was a problem hiding this comment.
Here as well, let's add the empty line back
| const toggleMute = () => { | ||
| if (volume.get() !== 0) { | ||
| lastNonZeroVolume.set(volume.get()); | ||
| } | ||
| updateVolume(volume.get() === 0 ? lastNonZeroVolume.get() : 0); | ||
| }; |
There was a problem hiding this comment.
How about moving this logic to the Volume context? Additionally, I strongly recommend adding a comment to clearly explain its purpose.
|
|
||
| if (prevIsMutedRef.current && prevVolumeRef.current === 0 && !status.isMuted) { | ||
| updateVolume(0.25); | ||
| if (prevIsMuted.get() && prevVolume.get() === 0 && !status.isMuted) { |
There was a problem hiding this comment.
Let's add a comment explaining why this logic is necessary
29e66fd to
d8c55a8
Compare
|
@hungvu193 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@hungvu193 Please check out the original PR that caused this issue. The idea was to implement it similarly to how youtube works, and remove the faulty code and refs completely |
|
Thanks for the context. I'll take a look |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-12-06.at.00.08.47.movAndroid: mWeb ChromeUploading mWeb.mov..... iOS: NativeIOS.moviOS: mWeb SafariScreen.Recording.2024-12-06.at.00.20.06.movMacOS: Chrome / SafariScreen.Recording.2024-12-05.at.23.58.59.movScreen.Recording.2024-11-17.at.18.20.31.movMacOS: DesktopDesk.mov |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #52858 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/blimpich in version: 9.0.73-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.0.73-8 🚀
|
Explanation of Change
The logic responsible for proper mute and unmute functionality has been implemented, eliminating audio instability issues on mobile devices.
Fixed Issues
$ #52858
$
PROPOSAL:
Tests
Expected behavior:
The volume remains at the level it was set to.
Offline tests
unnecessary
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android.native_2.mp4
Android: mWeb Chrome
android.web.mp4
iOS: Native
ios.native.mp4
iOS: mWeb Safari
ios.web.mp4
MacOS: Chrome / Safari
Screen.Recording.2024-12-05.at.08.53.23.mp4
MacOS: Desktop
desktop.mac_1.mp4