-
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 video sharing #38407
Fix video sharing #38407
Conversation
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 tried to review this and left some of my comments and questions. As I'm not super familiar with the app code yet, maybe some of the questions don't make much sense.
I don't see any huge red flags here. BasePlayer
itself has a lot of complex logic in hooks so Im not sure I understand how everything works there - but like I said Im not yet familiar with this.
Left you some naming suggestions and some questions
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.
Alright looks pretty good with my limited knowledge about video player 👍
@ishpaul777 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] |
@Skalakid Can you please resolve conflicts |
nvm, above is not related ⬆️ |
bug: Not able to pause video (by clicking on video itself) in full screen it starts playing as soon as i pause Screen.Recording.2024-03-22.at.5.32.18.PM.mov |
Bug: there's a loading indicator and video restarts when changing windowsize after a breakpoint in attachment carousel Screen.Recording.2024-03-22.at.5.45.53.PM.movbug: video stops playing in chat after a breakpoing in chat Screen.Recording.2024-03-22.at.5.54.32.PM.movBug?: it takes few second to play video when video timing is backed (it seems it redownloads the video everytime) Screen.Recording.2024-03-22.at.6.22.57.PM.mov |
thats it for now @Skalakid can you address above comments once you got sometime, thank you! |
I don't think it is a bug. Video reloads when changing window size and hitting breakpoint because on small screens, the in-chat video player isn't available and we can't share video elements that don't exit. So it is like natural behaviour because we have to stop sharing video elements and render separate players directly inside the attachment carousel
Same as above. In-chat video player isn't available on small screen devices. That why we are changing currently playing video to video thumbnail button that opens attachment carousel with the video inside |
Hmm, I think is not related to this PR. The same thing appears on main and probably that how native android player works. It can be connected how our backend returns video to our app. It accepts video ranges and probably Android native video player doesn't load entire file, only parts of it. After some time cached parts of the video are removed. |
@ishpaul777 I've added review changes and answered to you comments, let me know what do you think :D |
@ishpaul777 I resolved conflicts |
Thanks, Did breif testing for web desktop, it seems to work well, i'll priortize a full review for tomorrow its EOD for me, sorry! |
Okay, no problem. Thanks |
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.
lgtm!
@lakchote looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
✋ 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/lakchote in version: 1.4.58-0 🚀
|
Not an emergency, reviewer has completed all the checklist boxes. Removing label. |
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.58-8 🚀
|
// update shared video elements | ||
useEffect(() => { | ||
if (shouldUseSharedVideoElement || url !== currentlyPlayingURL) { | ||
if (shouldUseSharedVideoElement || url !== currentlyPlayingURL || isFullScreenRef.current) { |
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.
Hi @Skalakid I wonder why do we need to add isFullScreenRef.current
?
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.
isFullScreenRef
is responsible for locking the video player when screen orientation changes in full-screen mode. It prevents video players from changing their state because of device rotation or window size changes. Changing state causes the full screen to dismiss. We need it here to block updating currently shared video element
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.
Thanks
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.
Can you help me reproduce the bug if we remove isFullScreenRef.current
? Thanks
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.
Hi, @Skalakid
I'm also curious about test steps that cause unexpected errors when we remove isFullScreenRef.current
.
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.
We try to remove isFullScreenRef.current
only in this useEffect if statement.
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.
@Skalakid
Thank you for your confirm. I can't reproduce on my end.
Could you please let me know if this issue is reproducible on native devices?
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.
Confirmed again, it's not reproducible on my end.
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.
We try to remove isFullScreenRef.current only in this useEffect if statement.
@tienifr oh thanks for information, in the video above I deleted isFullScreenRef
in whole BaseVideo Player file 😅 So if it works after deleting isFullScreenRef.current
in useEffect, just do the test steps from this issue description and if everything works you can remove it
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.
@Skalakid
thank you for your check.
Details
This PR reenables video sharing feature. With these changes videos from inside the chat will be sharing their state with the player that is inside the attachment carousel.
Fixed Issues
$ #36873
PROPOSAL: #36873 (comment)
Tests
Button linking:
Window dimension changing:
Web & desktop:
Native devices:
Offline tests
Same as Tests
QA Steps
Same as Tests
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop