Skip to content
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

Slider handle current time #2255

Closed
wants to merge 3 commits into from

Conversation

mmcc
Copy link
Member

@mmcc mmcc commented Jun 11, 2015

This adds a data-current-time attr to the play progress bar, and adds CSS necessary to show that when you hover over the progress control.

handle hover

right: -1.5em;
font-size: 0.6em;
color: $primary-bg;
content: attr(data-current-time);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has a much higher browser usage than I though, cool.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was honestly pretty astonished to see it works in IE8. TIL.

@gkatsev
Copy link
Member

gkatsev commented Jun 11, 2015

One question, LGTM otherwise.

@mmcc
Copy link
Member Author

mmcc commented Jun 11, 2015

@gkatsev I like that idea. Last commit splits out that logic (even though I think it's functionally the same now).

/* Also show the current time tooltip */
.video-js .vjs-progress-control:hover .vjs-play-progress:after {
display: block;
font-size: 0.6em;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does the font-size change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone wants it always up (a la Vimeo), they could just set the main
one to display: block. If we don't change the font size on hover, it's
comically huge.
On Wed, Jun 10, 2015 at 6:33 PM Gary Katsevman notifications@github.com
wrote:

In src/css/components/_progress.scss
#2255 (comment):

@@ -27,6 +27,12 @@
/* We need an increased hit area on hover */
.video-js .vjs-progress-control:hover .vjs-progress-holder { font-size: 1.666666666666666666em }

+/* Also show the current time tooltip */
+.video-js .vjs-progress-control:hover .vjs-play-progress:after {

  • display: block;
  • font-size: 0.6em;

why does the font-size change?


Reply to this email directly or view it on GitHub
https://github.com/videojs/video.js/pull/2255/files#r32183524.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not quite following, sorry.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you set .video-js .vjs-play-progress:after to display: block, it would look fine at 0.9em. If we don't reduce the font size here on hover, however, it ends up way too big (imo).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. On hover, you want it slightly smaller following the mouse, but if you want it always on, you want it slightly bigger.
The only issue is that if you turn it on manually to always show, on hover, the font-size will change and it will flicker.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it still grows a tiny bit, it's just a smaller percentage of the bigger progress holder font-size.

But yes, you're right. There's definitely a hitch when you roll off. Bummer.

hitch

@mmcc mmcc force-pushed the slider-handle-current-time branch from 75121f9 to f52d8a3 Compare June 11, 2015 03:17
@gkatsev
Copy link
Member

gkatsev commented Jun 11, 2015

LGTM

@mmcc mmcc force-pushed the slider-handle-current-time branch from f52d8a3 to 35a5bdb Compare June 15, 2015 07:23
@pam
Copy link

pam commented Jun 15, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 35a5bdb
Build details: https://travis-ci.org/pam/video.js/builds/66826268

(Please note that this is a fully automated comment.)

@mmcc
Copy link
Member Author

mmcc commented Jun 15, 2015

@pam retry

@pam
Copy link

pam commented Jun 15, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 35a5bdb
Build details: https://travis-ci.org/pam/video.js/builds/66826943

(Please note that this is a fully automated comment.)

right: -1.5em;
font-size: 0.9em;
color: $primary-bg;
content: attr(data-current-time);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work in IE8?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YES

@mmcc mmcc closed this in ba4ab80 Jul 9, 2015
@heff
Copy link
Member

heff commented Jul 9, 2015

Merged in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants