-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 unable to adjust volume by clicking on any part of the volume slider #37094
Fix unable to adjust volume by clicking on any part of the volume slider #37094
Conversation
@cubuspl42 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] |
src/components/VideoPlayer/VideoPlayerControls/VolumeButton/index.js
Outdated
Show resolved
Hide resolved
const val = Math.floor((1 - event.y / sliderHeight) * 100) / 100; | ||
volume.value = Math.min(Math.max(val, 0), 1); | ||
}; | ||
|
||
const pan = Gesture.Pan() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
notable lack of memoization in this component. NAB without benchmarks though
@@ -42,15 +42,20 @@ function VolumeButton({style, small}) { | |||
setSliderHeight(e.nativeEvent.layout.height); | |||
}; | |||
|
|||
const gestureEventHandler = (event) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is against the Expensify guidelines. I believe it should be handleGestureEvent
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, even better, changeVolumeOnPan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kowczarz Bump! 🙂
@roryabraham @cubuspl42 I've added review changes |
In the future, prefer videos over screenshots for interactive behaviors. Screenshots are good for CSS/styling/visual fixes of static (non-moving content). |
You should always fill-in the "Tests" section, even when the testing steps are trivial. In this case, I can guess the reasonable testing steps, but this is especially bad when the videos are lacking. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativevolume-slider-adjust-android-compressed.mp4Android: mWeb Chromevolume-slider-adjust-android-web-compressed.mp4iOS: Nativevolume-slider-adjust-ios-compressed.mp4iOS: mWeb Safarivolume-slider-adjust-ios-web-compressed.mp4MacOS: Chrome / Safarivolume-slider-adjust-web-converted.mp4MacOS: Desktopvolume-slider-adjust-desktop-converted.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've run into two (very likely unrelated) issues:
- on iOS/Native, I hear no sound at all. I use a simulator, but I can hear the sound of the uploaded video both in the Photos app and in Expensify on iOS/Web (Safari)
- on iOS/Web (Safari), muting by tapping the "🔊" icon doesn't work
@kowczarz
Do these cases work for you?
Since @kowczarz is unavailable, I took over this issue and PR. VIdeos should be muted when playing for the first time. Also, the video slider shouldn't be visible on native devices. iOS.native.movHowever, you are right with the iOS/Safari, muting by tapping the "🔊" icon doesn't work. I will try to fix it in this PR |
@cubuspl42 I've just fixed the problem with the volume button on iOS/Safari. Please check if it is working for you now |
In the case the iOS/Native sound issue was codec-related, here's the testing video I used: rain_10s.mp4Anyway, there's no reason to block this PR on that. |
✋ 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/roryabraham in version: 1.4.45-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.45-6 🚀
|
Details
Fixed Issues
$ #36952
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
![android web](https://github.com/Expensify/App/assets/91068263/b847a5a9-6f10-47be-b7c0-7d78b55cd94b)iOS: Native
![ios native](https://github.com/Expensify/App/assets/91068263/158d02e6-98d1-478d-82e3-e4a4066b5fb0)iOS: mWeb Safari
![ios web](https://github.com/Expensify/App/assets/91068263/36a279a6-1278-4434-9db4-31966d929bf6)MacOS: Chrome / Safari
web_H.265.mp4
MacOS: Desktop
desktop_H.265.mp4