-
Notifications
You must be signed in to change notification settings - Fork 44
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
Custom timeline & timeline tooltip #1021
Custom timeline & timeline tooltip #1021
Conversation
Draft. I will create our custom timeline bar and replace video.js one |
be72982
to
7b23ef0
Compare
1b2bb3f
to
7d802be
Compare
7b23ef0
to
3db20bd
Compare
39b0b55
to
c54f9e5
Compare
3db20bd
to
5090893
Compare
f96b8bd
to
b0daf59
Compare
const duration = player.duration() | ||
const bufferedEnd = player.bufferedEnd() | ||
const loadProgressPercentage = round((bufferedEnd / duration) * 100, 2) | ||
setLoadProgressWidth(loadProgressPercentage) |
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.
Are we sure this logic is correct? I've noticed weird behaviour, even if I scrub to time that is allegedly already buffered, it still has to load:
Screen.Recording.2021-07-27.at.12.29.20.mov
This could be just buffering behaviour of video.js but if I look at the old player, clicking on the buffered area doesn't cause any loading, may be worth investigating
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.
should be fixed. It's not super perfect, but the native video.js
timeline is not perfect either. https://github.com/videojs/video.js/blob/4238f5c1d88890547153e7e1de7bd0d1d8e0b236/src/js/control-bar/progress-control/load-progress-bar.js This could direct you why I did that. Basically player.buffer() returns an object with just two methods(start, end) and property length
. Length
tells how many buffered time ranges are present in the video timeline, I just need to find and take the one which is close to the current video time.
Some other UX things I just noticed:
Screen.Recording.2021-07-27.at.12.42.16.mov
|
cff0296
to
13424bd
Compare
|
…instead of event listener
* fix issue with out of bound tooltip on the right * patch the timetooltip and mousetimedisplay, style timeline tooltip * rebase * remove videojs patch * add custom timeline * refactor * add shadow and animation to tooltip * extract CustomTimeline to separate component * refactor * reduce useRefs, use css clamp * use clamp for tooltip * mobile improvements * buffer fix, cr fixes * improve scrubbing * add transition delay * fixes * expand ProgressControl area when scrubbing * fixed scrubbing on fullscreen, add pointer to thumb, use setInterval instead of event listener
Fix #937
Figma: https://www.figma.com/file/TGUpBXgXf9ceMvHbRB5BIx/Joystream-Atlas?node-id=9977%3A263879
https://www.figma.com/file/TGUpBXgXf9ceMvHbRB5BIx/Joystream-Atlas?node-id=9164%3A0
I really hate the fact that I had to patch the video.js library, but it works surprisingly well ¯_(ツ)_/¯