-
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 sharing video player from chat to attachment modal #37202
Fix sharing video player from chat to attachment modal #37202
Conversation
@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] |
I can take a look in 1-2 hour 👀 |
@Skalakid Can you please help me understand the root cause and how these code changes solve the problem, this will be really helpful while reviewing :D |
const currentDuration = e.durationMillis || videoDuration * 1000; | ||
const currentPositon = e.positionMillis || 0; | ||
|
||
if (shouldReplayVideo(e, isVideoPlaying, currentDuration, currentPositon)) { |
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.
Not a bug but can we consider moving shouldReplayVideo
utility to libs directory?
looks like clicking on the video does not play/pause the video Screen.Recording.2024-02-26.at.10.53.43.PM.mov |
@ishpaul777 no problem. Here is an explanation. We wanted to optimize video player loading when switching from an in-chat player to an attachment carousel. So we implemented video element sharing, so we can use exactly the same element both in chat and in the attachment modal. This feature is only available on large-screen devices. Buttons don't work when exiting the attachment modal because sharing wasn't fully made and we didn't bind the functions after exiting the attachment carousel. By fixing video player sharing bot players are always synchronized and functions are properly binded |
Thanks for explaination @Skalakid, changes start to make sense 👌 looks like you are looking into #37202 (comment), please feel free to ping me and share your findings i'll be around 😄 |
@ishpaul777 Good catch, I forgot that we can pause video by clicking on it 😅 I've just added the fix for it |
reviewing 👀 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-02-27.at.11.42.47.PM.movAndroid: mWeb ChromeScreen.Recording.2024-02-27.at.11.35.05.PM.moviOS: NativeScreen.Recording.2024-02-28.at.12.07.20.AM.moviOS: mWeb SafariScreen.Recording.2024-02-28.at.12.13.22.AM.movMacOS: Chrome / SafariScreen.Recording.2024-02-27.at.11.17.46.PM.movMacOS: DesktopScreen.Recording.2024-02-28.at.12.22.28.AM.mov |
Another bug:The play and pause not works when the we naviagate from other carousel item. Step to repro:
Expected result: Actual Result: Screen.Recording.2024-02-27.at.10.04.28.PM.mov |
Just tested again the above 👆 not able to reproduce so i wont block this for a bug i am not able to reproduce consistently but its worth a investigation if you are able to reproduce @Skalakid Screen.Recording.2024-02-27.at.11.17.46.PM.mov |
@ishpaul777 I can't reproduce it either, but I will look into this and if there is need I will fix it in another PR |
@ishpaul777 Do you approve this PR, so we can merge it or should I add something to it? |
Ah i thought you were investigating for the bug above mentioned. I'll approve as soon as i am with my laptop (1-2 hours) just want to test one last time again before approving. |
I couldn't reproduce either @ishpaul777. We should still keep this in mind if the problem arises @Skalakid |
✋ 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.47-0 🚀
|
@@ -108,6 +108,7 @@ function CarouselItem({item, onPress, isFocused, isModalHovered}) { | |||
isHovered={isModalHovered} | |||
isFocused={isFocused} | |||
optionalVideoDuration={item.duration} | |||
isUsedInCarousel |
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 caused this a regression here: #37750
🚀 Deployed to production by https://github.com/roryabraham in version: 1.4.47-10 🚀
|
const currentDuration = e.durationMillis || videoDuration * 1000; | ||
const currentPositon = e.positionMillis || 0; | ||
|
||
if (shouldReplayVideo(e, isVideoPlaying, currentDuration, currentPositon)) { |
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 change of replacing isPlaying
caused a bug #37249
Details
The PR fixes video player sharing between elements and screen.
Fixed Issues
$ #36873 (comment)
PROPOSAL:
Tests
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 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
N/A
Android: mWeb Chrome
N/A
iOS: Native
N/A
iOS: mWeb Safari
N/A
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov