-
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 Hide video playback controls on auto-playing videos #43349
Conversation
I am updating the recording. |
The video on iOS don't seem to be autoplaying is that correct? Can you do some recordings of how this looks for a in a chat thread? Checked out the PR locally and the desktop versions feels good to me. A bit harder to get a feel for native, but it looks alright at first glance. cc @Expensify/design |
Going OOO for the next 7 days, so @shawnborton and @dannymcclain will be able to assist with the last few details :) |
@rojiphil Can you help review the PR? |
Reviewing today |
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.
For feature training videos on mobile devices, the video plays automatically and we do not show the controls by default. This works fine.
- But when a video
Attachment
is played (I.e. either via tap or on theplay
button onplayback controls
), theplayback controls
do not fade away as per OP expectations. Did we miss implementing this?
Also, I have a few additional observations and follow-up queries:
-
Currently, the fading away feature will get triggered when
played
andpaused
.
Curious to know if theplayback controls
should remain shown whenpaused
on mobile. Or is it fine for theplayback controls
to fade away whenpaused
? -
Also, when popover is visible, shouldn’t the
playback controls
remain displayed and not fade away?
What do you think?
Please find recordings below. iOS Native43349-ios-native-000.mp4mWeb Chrome43349-mweb-chrome-000.mp4 |
Perhaps we did not implement this, and we probably should implement it?
I think I would expect the controls to remain there even if the video is paused? But if you tap the video outside of the pause button, I would expect the video to remain paused but the controls to fade away.
Popover as in the training modal? I think we'd want to fade those away too. |
I meant the popover menu with menu options |
So, if I understand correctly,
Is this understanding correct? |
I think that sounds right to me, yup. |
@shawnborton I have a few thing need to confirm:
|
This seems okay to me though. Or maybe, what exactly are you asking me here? Anything else you need me to clear up? |
@shawnborton With the feature:
|
Ah, I think maybe the idea is that as long as the video is playing, the controls will eventually fade out. Then you tap to get them to come back. But if you tap and pause, the controls stay in place. Does that sound right @Expensify/design ? |
Yup that sounds right to me. |
In your mobile video it looks like it's correct where the controls aren't showing, but given your cursor is above the video when it pops up it's hard to tell. Can you do a recording where you tap track submit and your cursor goes off to see if the controls never show? |
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.
@tienifr I have left a comment for an issue that is demonstrated in test video below. Please have a look. Otherwise, I think we are very close to getting this done.
43349-hide-controls-issue.mp4
@@ -311,7 +358,10 @@ function BaseVideoPlayer({ | |||
if (isFullScreenRef.current) { | |||
return; | |||
} | |||
togglePlayCurrentVideo(); | |||
if (!canUseTouchScreen) { | |||
togglePlayCurrentVideo(); |
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 think we need an early return here. Otherwise, showControl
will trigger the timer to hide the controls for large screen devices.
togglePlayCurrentVideo(); | |
togglePlayCurrentVideo(); | |
return; |
@dubielzyk-expensify From the code perspective, there is only one pending issue left. As soon as it is addressed, I suggest that we trigger a build (via |
I can trigger the build now. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
Yeah. Reviewing in parallel maybe even better. Just one thing to note. There is one pending issue as mentioned here |
Ohh this is looking good. I got two notes:
|
I updated PR
@dubielzyk-expensify Currently, the controls stay visible fully for 2000ms, and fade out for 500ms. I made it disappear at once. |
I think keep everything as it was, just reduce the 2000ms down to 1500ms. |
Updated. |
@dubielzyk-expensify The commits after the above statements has impacted test step A-9 as mentioned here. As per step A-9, if we keep continually tapping on the video player within the timeout interval, the video controls remain shown. However, the controls will auto hide if timeout interval is exhausted after the most recent tap inside video player. The recent commits though forcefully hides the controls on every tap thereby impacting step A-9. Here is a test video after recent commits and I think it’s jittery. Can you confirm if it was intentional to change step A-9 or were you just concerned about reducing the time interval from 2 sec to 1.5 sec? 43349-ios-native-conf-01.mp4 |
The goal was that if the controls aren't showing, tapping the screen should show them. And reversely, if the controls aren't showing, tapping them show reveal them. So tapping many times on the screen should show, hide, repeat, multiple times. Tapping the screen should reset the timer for auto-hiding the controls so if a user interacts with it, it should override that behaviour anyways. Basically the list of interactions are as follow:
Does that make sense? |
Thanks @dubielzyk-expensify for the clarification. |
@tienifr Can you please merge with the latest main? And I can complete the checklist. Thanks. |
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / Safari43349-web-safari-006.mp4MacOS: Desktop43349-desktop-006.mp4iOS: mWeb Safari43349-mweb-safari-006.mp4Android: Native43349-android-native-006.mp4Android: mWeb Chrome43349-mweb-chrome-006.mp4iOS: Native43349-ios-native-006.mp4 |
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.
@tienifr Thanks. Just one note. Please update the test cases for QA as mentioned here.
@dubielzyk-expensify Can you please also have one final look at the test steps here just to ensure that we are all on the same page? Thanks.
@MariaHCD I have completed the reviewer checklist and the improvements works well too. Over to you for review.
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, after approval from design, we should be good to go
Those test steps look good to me 👍 |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
FYI I believe this was deployed to prod yesterday, from this checklist - #47219 |
Details
Fixed Issues
$ #42323
PROPOSAL: #42323 (comment)
Tests
Offline tests
NA
QA Steps
Prerequisite: Native and mWeb platforms only
A) Testing feature training video player:
Track Expense
does not show the video controls by default. (#Test 1)video player
once (i.e. do not tap repeatedly) while the video still plays.video controls
are displayed in thevideo player
(#Test 2)video controls
fades away after 1.5 seconds (#Test 4)video player
again so that thevideo controls
are displayed.video player
within 1.5 seconds and verify that thevideo controls
fade away (#Test 5)video player
once to show thevideo controls
again.Pause
button available in thevideo controls
to pause the play and verify that thevideo controls
do not fade away (#Test 6)Play
button available in thevideo controls
to start playing again3DotMenu
available in thevideo controls
and verify that thevideo controls
do not fade away (#Test 7)Got it
button to close the feature training video.B) Testing non-feature training video player:
attachment
to launch the video which explains how to track your spendvideo controls
fade away after 1.5 seconds. (#Test 8)Prerequisite: Web and Desktop versions.
C) Testing non-feature and feature training video player
Track Expense
does not show the video controls by default. (#Test 9)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
Screen.Recording.2024-06-10.at.17.59.32.mov
Android: mWeb Chrome
iOS: Native
Screen.Recording.2024-06-10.at.17.51.38.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2024-06-10.at.17.14.04.mov
43349-test-video-001.mp4
MacOS: Desktop