-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Mouse time display #2569
Mouse time display #2569
Conversation
position: absolute; | ||
right: 0; | ||
left: 0; | ||
top: calc(50% - 0.15em); |
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.
calc
is terrible support, so, I'll probably need to swap it out to something else.
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.
Yeah...we just do the math manually other places. This is centering it, yeah?
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.
yep. I'll probably figure out the number directly closer to the final version of this PR.
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: 1a0bd97 (Please note that this is a fully automated comment.) |
I think if the progress hover is on by default, this should be too.
I think just one, and preferably the normal play-progress hover item for consistency.
I like the inverted play progress styling, but I think there needs to be a "handle" of some kind on the actual progress bar. The current hover tooltip looks solid as is, but it feels a little disembodied without something on the actual progress bar itself. In keeping with the tooltip, what about an inverted play handle? For future note and other people keeping an eye on this, the inversion styling is great for themes like colors.
I'm ambivalent about this one. My gut instinct is that this should mirror the final decision for the second bullet point. |
I think so. We're only showing remaining time by default now, but with this you can hover over the end and get the duration a little more easily.
I think only the current current play progress should show up. Seems like it would feel weird if two times are floating around when you're scrubbing. We should probably try out the different options for real though.
I'd say set it to a black background with opacity and white font. I'm interested to see what the color skins look like with the the inversion, but it doesn't seem safe to assume the inverted color will work for most skins. For example if you were making a monochrome blue skin the tool tip would be orange by default and you'd have to fix that. Black background seems safer. Also it looks ok to me without a handle. Vimeo doesn't have anything below the tip, Youtube has a mock progress bar, Hulu just has one handle that always tracks the mouse, and Netflix has a thin line on the bar. I'm fine with adding something but I'd lean away from making it look like another handle since it's not really a handle. I like the Netflix line if we're doing anything.
I think it should go under. See Vimeo. That feels right to me. |
I guess I should mention that this definitely isn't complete. The "inverted color" is just a placeholder. |
All of these are what I had in mind when I was talking about making it feel less disembodied. Even the Vimeo tooltip has a bottom arrow attaching it to the progress bar (and it's much closer). Agreed, the full-on inverted handle thing is a bad idea (although I kinda like the YT approach), but there has to be something. |
Got it, yeah I agree with at least having a point coming down from the time to the progress bar. |
|
||
update() { | ||
this.updateDataAttr(); | ||
this.update_(); |
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 is throwing an error that update_
doesn't exist
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.
That's... weird. This object inherits from SeekBar that inherits from Slider which has the update_
method.
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.
Huh, weird, getting that now.
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.
OH. I know what the issue is. It's because I had some left over code from when I was trying to do performance optimizations and figuring out how the slider and seekbar worked.
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.
Fixed.
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: 90f3503 (Please note that this is a fully automated comment.) |
Handle className specially.
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: 16616ff (Please note that this is a fully automated comment.) |
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: 1430736 (Please note that this is a fully automated comment.) |
Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED Commit: b2d2770 (Please note that this is a fully automated comment.) |
Until we fix the performance issues with scrubbing, I vote for leaving this item showing up as well. It makes it much easier to scrub seek. |
Honestly, I feel pretty strongly about something associating it more with the timeline, but I don't think it should block this PR from getting merged. IMO, that's purely a stylistic decision that we can revisit later, or even just wait for more feedback from other devs / users. |
Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED Commit: abeb30e (Please note that this is a fully automated comment.) |
After trying this out I agree with Gary that we should keep it there while scrubbing. It does feel a little weird though so hopefully we can figure out how to improve scrubbing soon. |
getPointerPosition takes an element and a DOM Event object. It will return an object with x and y coordinates based on the bottom left of the element.
This element is a child of seek-bar and is styled in the _progress.scss file.
createEl() { | ||
return super.createEl('div', { | ||
className: 'vjs-progress-holder', | ||
createEl(type='div', props={}) { |
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.
going to revert this since I'm no longer using it.
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: b454b4f (Please note that this is a fully automated comment.) |
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: c637e04 (Please note that this is a fully automated comment.) |
…tly. Make sure position is set to a value.
Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED Commit: fb845fb (Please note that this is a fully automated comment.) |
No z-index for time display when vjs-no-flex is set. This is so that on devices like IE8, the time display will always show up behind the play progress and current time display.
Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED Commit: ffc0ac5 (Please note that this is a fully automated comment.) |
@@ -53,6 +54,13 @@ | |||
top: 0; | |||
} | |||
|
|||
.video-js .vjs-mouse-display { |
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.
Is this still needed?
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.
yes. This makes the two displays the same size. I can move it down in the file, if you'd like.
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.
Ah! I see. Cool. Here's good.
Looks great! A few minor comments but otherwise looks good to me. |
update now takes a newTime and a position and will update the position and text of the display. handleMouseMove will use the mouse event to figure out where to update. This is to separate the actual updating from using the event object to get the new time and position.
In no-flex, just force display:none.
Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED Commit: 215fcf1 (Please note that this is a fully automated comment.) |
lgtm! |
Things that need to be decided:
Answers: