-
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
Don't play video if app is not visible #47217
Don't play video if app is not visible #47217
Conversation
@aimane-chnaif 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] |
@@ -94,12 +100,23 @@ function PlaybackContextProvider({children}: ChildrenProps) { | |||
// This prevents the video that plays when the app opens from being interrupted when currentReportID | |||
// is initially empty or '-1', or when it changes from empty/'-1' to another value | |||
// after the report screen in the central pane is mounted on the large screen. | |||
if (!currentReportID || !prevCurrentReportID || currentReportID === '-1' || prevCurrentReportID === '-1') { | |||
if (!currentReportID || !prevCurrentReportID || currentReportID === '-1' || prevCurrentReportID === '-1' || currentReportID === prevCurrentReportID) { |
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 added this since resetVideoPlayerData
is called which clears the ref and the pending play video below won't do anything since the ref is already null. So, when we come back to the app/tab, the video isn't played.
It was added and explained here. I somehow miss the case to compare the prev and current value.
You skipped pre-steps.
This doesn't work for existing accounts. It shows not found page. It's pre-requisite to test with new acount. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid2.mp4Android: mWeb ChromeiOS: Nativeios.moviOS: mWeb SafariMacOS: Chrome / Safariweb1.movweb2.movMacOS: Desktop |
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.
Looks good.
@bernhardoj please see #47217 (comment)
Updated |
✋ 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/techievivek in version: 9.0.20-0 🚀
|
FYI I believe this was deployed to prod yesterday, from this checklist - #47356 |
Details
When a video is played while the app is in background, a console error is thrown. This PR fix it.
Fixed Issues
$ #47162
PROPOSAL: #47162 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
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 methodSTYLE.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 and/or tagged@Expensify/design
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.mp4
Android: mWeb Chrome
android.mweb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4