-
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: Inconsistency of flashlight/torch behavior in Scan tab #34782
Conversation
@s77rt I have some problems when record video for android/ios web. Previously, I used ngrok to test on dev, but seem like BE prevented login though exotic domain recently. Do you have any ways to test on physical device? Thanks a lot |
I can't test this either. My phone does not seem to support the web camera feature neither the simulator. Will ask for someone to take over this PR review/test |
This comment has been minimized.
This comment has been minimized.
@s77rt @tienifr I tested the adhoc builds on the Android and iOS Physical devices. Attached are the videos. The expected result works fine on native iOS and Android app. mWeb Safari no flash light icon (expected result). mWeb Chrome turning on the flashlight has not impact on the camera flash. Video for iOS native app. ios-flashlight_TXCG8SJ1.mp4Video for mWeb Safari. mweb-safari-flashlight.MP4Video for Android native app: android-flashlight.mp4Video for mWeb Chrome. mweb-chrome-flashlight.mp4 |
@mananjadhav Thanks for your help. I think we need to delay taking a picture when users enable torch/flashlight cc @s77rt. I already posted the changes. |
@tienifr The use of setTimeout is discouraged. Can we instead implement a |
@s77rt Ok,
but I'm not sure it works, we need to test on real device |
@mananjadhav Can you please test again |
Sure can we trigger the adhoc build? That would be the fastest to test. |
@mountiny Can you please trigger adhoc build |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
@s77rt Seem like using |
@tienifr Why it's not working in this case? Shouldn't the |
@s77rt I think applyConstraints promise can't guarantee that the picture is taken with flash. I'm finding the RCA and other solution. Do you have any suggestion? |
The example on MDN https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/applyConstraints#examples shows like what we are doing should be possible. Maybe there is a problem with |
checking... |
@s77rt After checking, torch is already on before triggering |
When using camera App in android, I can see it has some delay (~2s) before taking the photo (with torch is on). That's the reason we should do the same |
That still does not make much sense. How is it possible that the flash is on and still get a photo with no flash? We shouldn't use setTimeout unless it's necessary. At this point I think we still need to know why this is failing |
check out this one: first capture without falsh. second capture with flash. RPReplay_Final1710772980.MP4 |
@ishpaul777 Please do same test on mWeb, it should have similar feel as in native |
@ishpaul777 What's your device? |
iphone 15 plus |
Works well! trim.619ADF29-B91D-4753-8662-08555399A14F.MOV |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.mp4Android: mWeb Chromemweb-chrome.moviOS: Nativeios.mp4 |
@tienifr Can you please clear up / remove duplicated testing steps and just specify that the flash should be turned on after pressing the shutter button |
This may be confusing, the button should turn into a pressed state (highlighted). Instead specify that the flash is not turned on yet |
@s77rt Thanks for your suggestions. I updated |
@tienifr we have conflicts |
@luacmartins fixed conflicts |
@luacmartins looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Tests were passing |
✋ 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/luacmartins in version: 1.4.56-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.56-8 🚀
|
Details
Fixed Issues
$ #34457
PROPOSAL: #34457 (comment)
Tests
Offline tests
Same as above
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)/** comment above it */
this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop