-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$500] Web - Video - play speed after returning from thread does not update #37722
Comments
Triggered auto assignment to @MitchExpensify ( |
@MitchExpensify I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Web - Video - App crashes when changing play speed after returning from thread What is the root cause of that problem?When returning from the tread and changing the playback speed of the video App/src/components/VideoPlayerContexts/VideoPopoverMenuContext.js Lines 21 to 27 in 9411a08
This is because videoRef comes from PlaybackContext here
When returning from the threads, it resets in this useEffect App/src/components/VideoPlayerContexts/PlaybackContext.js Lines 92 to 97 in 9411a08
and basically resets the player ref in this function App/src/components/VideoPlayerContexts/PlaybackContext.js Lines 83 to 90 in 9411a08
thus, the running video has no valid ref and trying to call functions on it, crashes the app What changes do you think we should make in order to solve the problem?In the initial chat and in the other chat thread the App/src/components/VideoPlayerContexts/PlaybackContext.js Lines 92 to 97 in 9411a08
I don't see the point of resetting it when it is valid, only when it is null. So I propose to change it to useEffect(() => {
if (currentReportID) {
return;
}
resetVideoPlayerData();
}, [currentReportID, resetVideoPlayerData]); BeforeScreen.Recording.2024-03-05.at.14.28.48.movAfterScreen.Recording.2024-03-05.at.14.29.39.mov |
📣 @CristiCeban! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Wave Collect worthy I think: https://expensify.slack.com/archives/C036QM0SLJK/p1709924791377559 |
@MitchExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Bumping our fearless wave collect leader here https://expensify.slack.com/archives/C036QM0SLJK/p1710260567333629?thread_ts=1709924791.377559&cid=C036QM0SLJK |
Confirming if changing the playback speed is possible as part of stage 1 and stage 2 plans as a next step |
Job added to Upwork: https://www.upwork.com/jobs/~01fabf464f1c4f13cc |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.In the original OP, the app crashes when changing the video playback speed after opening the thread parent. Now, the ap doesn't crash, but the playback speed button doesn't work at all including the other video controls button (volume & download) What is the root cause of that problem?If we start playing a video, it will set the App/src/components/VideoPlayer/BaseVideoPlayer.js Lines 176 to 181 in 8b54aff
When we press the thread parent message, it will navigate to the thread parent and mount a new report screen and also the video player preview (which will render the video player) which triggers the above We have a logic to reset the video player data, including the App/src/components/VideoPlayerContexts/PlaybackContext.tsx Lines 80 to 85 in 8b54aff
However, the current report ID value is updated with a delay and also the logic to clear the video player data is executed in a App/src/libs/Navigation/NavigationRoot.tsx Lines 120 to 122 in 8b54aff
When the video player (preview) is mounted, the So the App/src/components/VideoPlayerPreview/index.tsx Lines 62 to 67 in df28d85
After the current report ID is updated, the video player data is cleared. So, every time we try to update the playback speed, it does nothing because the video player ref now is null. Also, when navigating back to the thread parent report, we can still hear the previous video sound because it's not stopped yet and it's because the App/src/components/VideoPlayerContexts/PlaybackContext.tsx Lines 23 to 24 in e504806
What changes do you think we should make in order to solve the problem?The idea is to prevent rendering the video player component when the
Don't forget to pass
And to fix the undefined
Don't forget to update each useEffect and useCallback that is affected by above changes What alternative solutions did you explore? (Optional)If the So, I suggest to call
Then, we don't need the effect anymore App/src/components/VideoPlayerContexts/PlaybackContext.tsx Lines 83 to 88 in e504806
Last, we should set the thumbnail to true when the url doesn't match. App/src/components/VideoPlayerPreview/index.tsx Lines 62 to 67 in df28d85
|
The app doesn't crash anymore, but the root cause isn't fixed yet as shown in the video below. The playback speed button, volume, and download doesn't have any effect. Untitled.1.mov |
Do we all agree this is the new issue?
|
@MitchExpensify Here's my suggestion:
Expected Result:Step 9: We should not hear the sound from previous chat Actual Result:Step 9: We can hear the sound from previous chat |
@bernhardoj This solution didn't work on my side. I still can hear the sound. @tienifr Do you want to update your proposal to fix that case? |
Nice, updated! |
bump @bernhardoj @tienifr |
Updated my proposal |
will review today |
@bernhardoj Can you open the PR, so I can test it easier. BTW, your solution doesn't work after backing to the parent chat at first time, 2 videos play simultaneously. Did you face this problem? |
@dukenv0307 I don't remember encountering that problem when I was testing my solution, but I have posted a new solution that is more reliable. |
@bernhardoj Can you pls open the PR since you already got assigned? |
PR is here |
This issue has not been updated in over 15 days. @jasperhuangg, @MitchExpensify, @bernhardoj, @tienifr, @dukenv0307 eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
Looks like the fix for this was deployed 2 weeks ago, it seems the automation failed. |
@MitchExpensify I believe we need to pay out @bernhardoj for their PR solution and @dukenv0307 for the review |
Payment summary: $500 C @bernhardoj (Upwork) |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.4.47-0
Reproducible in staging?: Y
Reproducible in production?: Y
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal Team
Action Performed:
Expected Result:
Step 9: We should not hear the sound from previous chat
Step 11: Playback speed or volume should update
Actual Result:
Step 9: We can hear the sound from previous chat
Step 11: Playback speed or volume does not updated
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6402303_1709610042243.bandicam_2024-03-05_10-46-31-988.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: