-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Video] add scrubber to the web player #4943
Conversation
Your Render PR Server URL is https://social-app-pr-4943.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cqv5fvqj1k6c73bbotrg. |
|
src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx
Outdated
Show resolved
Hide resolved
b10ca61
to
a833028
Compare
useEffect(() => { | ||
// HACK: there's divergent browser behaviour about what to do when | ||
// a pointerUp event is fired outside the element that captured the | ||
// pointer. Firefox clicks on the element the mouse is over, so we have | ||
// to make everything unclickable while seeking -sfn | ||
if (isFirefox && scrubbing) { | ||
document.body.classList.add('force-no-clicks') | ||
|
||
return () => { | ||
document.body.classList.remove('force-no-clicks') | ||
} | ||
} | ||
}, [scrubbing]) |
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 was the least worst solution I could come up with for the firefox click issue
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 was actually able to break this if i take my cursor outside of the window while still pressing down. Can we prevent that from breaking?
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.
great work!
Left a little note in slack re: what pointers we should use (grabby hand? pointer? regular cursor?) We can tweak all of that in a different iteration.
const abortController = new AbortController() | ||
const {signal} = abortController | ||
document.documentElement.addEventListener( | ||
'mouseleave', | ||
() => { | ||
isSeekingRef.current = false | ||
onSeekEnd() | ||
setScrubberActive(false) | ||
}, | ||
{signal}, | ||
) |
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.
@haileyok is the mouse leaving the window a firefox-only issue or should I apply this fix on all browsers?
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 assume it is just firefox yea. i couldn't get it to repro in chrome or safari.
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.
Ok cool, this fix should be good then
* origin/main: (520 commits) Fix language filtering for feeds (#5026) Enable show_follow_back_label_v2 (#5022) Remove logging of following prefs (#5021) Remove new_user_guided_tour and tour code (#5023) [Video] Remove old env var (#5018) Profile screen performance tweak - Adjust initial num to render based on header height (#5005) [Video] Make compress/upload cancelable (#4996) [Video] Add uploaded video to post (#4884) [Video] Add `timeRemainingChange` event to `player` in `expo-video` (#5013) [Video] Lexicon implementation (#4881) Hide quote counts for quotegated posts (#5011) Ensure captcha verification code gets submitted in signup request (#5010) clean up languages (#5007) [Video] 🫧 Move logic around by platform (#5003) bump 1.91.0 (#5002) add indicator of time remaining (#5000) [Video] add scrubber to the web player (#4943) Release 1.90 prep (#4988) Use moderatePost_wrapped for post embeds (#4981) Update Indonesian translation (#4875) ...
Screen.Recording.2024-08-15.at.20.28.46.mov
Test plan
Known issueIf you mouseUp while the mouse is over a post (but not over the video), it'll navigate to the post.evt.preventDefault()
doesn't prevent itSolved! We make everything unclickable while scrubbing 😅