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

fix(control-bar): align center #7990

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

KangXinzhi
Copy link
Contributor

Description

[Please describe the change as necessary.
The bar is not centered in video control section
issues7989

Specific Changes proposed

Please list the specific changes involved in this pull request.

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chrome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
  • Reviewed by Two Core Contributors

@welcome
Copy link

welcome bot commented Nov 3, 2022

💖 Thanks for opening this pull request! 💖

Things that will help get your PR across the finish line:

  • Run npm run lint -- --errors locally to catch formatting errors earlier.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Merging #7990 (e2faeca) into next (fa57723) will decrease coverage by 0.97%.
The diff coverage is 95.00%.

❗ Current head e2faeca differs from pull request most recent head fd4dbe9. Consider uploading reports for the commit fd4dbe9 to get more accurate results

@@            Coverage Diff             @@
##             next    #7990      +/-   ##
==========================================
- Coverage   81.95%   80.98%   -0.98%     
==========================================
  Files         110      116       +6     
  Lines        7333     7472     +139     
  Branches     1767     1817      +50     
==========================================
+ Hits         6010     6051      +41     
- Misses       1323     1421      +98     
Impacted Files Coverage Δ
src/js/player.js 88.37% <50.00%> (-1.39%) ⬇️
src/js/event-target.js 100.00% <100.00%> (+4.25%) ⬆️
src/js/extend.js 85.71% <100.00%> (ø)
src/js/tech/html5.js 67.29% <100.00%> (+0.34%) ⬆️
src/js/tech/tech.js 83.00% <100.00%> (-0.72%) ⬇️
src/js/tracks/text-track.js 93.12% <100.00%> (+0.17%) ⬆️
src/js/utils/events.js 81.00% <100.00%> (+0.09%) ⬆️
src/js/poster-image.js 65.71% <0.00%> (-9.90%) ⬇️
src/js/utils/obj.js 68.75% <0.00%> (-6.77%) ⬇️
src/js/live-tracker.js 93.43% <0.00%> (-5.00%) ⬇️
... and 37 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@mister-ben mister-ben left a comment

Choose a reason for hiding this comment

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

This causes the opposite issue for me: the handle is too high. There's been a few reports of this before #7004 which users have fixed with some CSS. It seems specific to Chinese OS/page. I wonder if there's something different about font rendering with Chinese characters which affects em units.

@KangXinzhi
Copy link
Contributor Author

too high. There's been a few reports of th

When I open the videoJS official website, I have the same problem. and it has not any Chinese.

image

@mister-ben
Copy link
Contributor

I can replicate what you see if I run Chrome in Chinese Traditional on MacOS - the application rather than the page language is apparently what matters. I note the handle is slightly larger.

Removing those two top rules and replacing them with line-height: .35em; seems to work well with the browser in English, Chinese, Arabic, Hindi, Japanese on Mac Chrome, Safari, Firefox and Edge. Would need some testing on Windows - if it works there two, it looks like a solution. It should be merged into next rather than main - it could be a breaking change for custom styles.

@mister-ben
Copy link
Contributor

In this codepen, the first player uses the styling we currently have, and the second uses line-height instead of top. On all MacOS browsrs I've tried, the slider handles are in the correct place regarless of OS/app language for the second player.

I haven't tried on Windows as the standard edition of Windows doesn't let you change the OS/app language. If @KangXinzhi or anyone else could try this on Chinese (or other non-Latin script) Windows browsers it would be useful.

https://codepen.io/mister-ben/full/MWXeOKr

@KangXinzhi
Copy link
Contributor Author

KangXinzhi commented Nov 5, 2022

In this codepen, the first player uses the styling we currently have, and the second uses line-height instead of top. On all MacOS browsrs I've tried, the slider handles are in the correct place regarless of OS/app language for the second player.

I haven't tried on Windows as the standard edition of Windows doesn't let you change the OS/app language. If @KangXinzhi or anyone else could try this on Chinese (or other non-Latin script) Windows browsers it would be useful.

https://codepen.io/mister-ben/full/MWXeOKr

It is great when I try this on Chinese Windows browsers!
image

image

Comment on lines 52 to 55
.video-js .vjs-progress-control:hover .vjs-play-progress:before{
top: -0.333333333333333em;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.video-js .vjs-progress-control:hover .vjs-play-progress:before{
top: -0.333333333333333em;
}

@@ -79,8 +83,7 @@
font-size: 0.9em;
position: absolute;
right: -0.5em;
top: -0.333333333333333em;
z-index: 1;
top: -0.45em;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
top: -0.45em;
line-height: .35em;
z-index: 1;

@@ -157,7 +157,7 @@

// Volume handle
&:before {
top: -0.3em;
top: -0.45em;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
top: -0.45em;
line-height: .35em;

Copy link
Contributor

@mister-ben mister-ben left a comment

Choose a reason for hiding this comment

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

These suggested changes are as my codpen example.

@mister-ben mister-ben changed the base branch from main to next November 6, 2022 09:39
@mister-ben mister-ben changed the base branch from next to main November 6, 2022 09:39
@mister-ben
Copy link
Contributor

This could be a breaking change for custom skins, so should be in a major release - v8.x should be very soon now. Could you rebase agains the next branch?

@KangXinzhi KangXinzhi changed the base branch from main to next November 8, 2022 02:48
@KangXinzhi
Copy link
Contributor Author

This could be a breaking change for custom skins, so should be in a major release - v8.x should be very soon now. Could you rebase agains the next branch?

that's ok!

@mister-ben mister-ben added major 8.x needs: LGTM Needs one or more additional approvals labels Nov 8, 2022
Copy link
Member

@misteroneill misteroneill left a comment

Choose a reason for hiding this comment

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

Took a quick look and seems to work nicely. Thank you @KangXinzhi!

@misteroneill misteroneill merged commit 2b55958 into videojs:next Nov 8, 2022
@welcome
Copy link

welcome bot commented Nov 8, 2022

Congrats on merging your first pull request! 🎉🎉🎉

misteroneill pushed a commit that referenced this pull request Nov 23, 2022
…istent (#7990)

Fixes #7989

BREAKING CHANGE: This changes how slider handles are styled, so custom skins that are targeting them may need to change.
misteroneill pushed a commit that referenced this pull request Nov 23, 2022
…istent (#7990)

Fixes #7989

BREAKING CHANGE: This changes how slider handles are styled, so custom skins that are targeting them may need to change.
@misteroneill misteroneill removed the needs: LGTM Needs one or more additional approvals label May 23, 2023
@mister-ben mister-ben mentioned this pull request Jun 1, 2023
7 tasks
edirub pushed a commit to edirub/video.js that referenced this pull request Jun 8, 2023
…istent (videojs#7990)

Fixes videojs#7989

BREAKING CHANGE: This changes how slider handles are styled, so custom skins that are targeting them may need to change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants