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

border-box and padding-bottom kills the posterImage #1335

Closed
scottconnerly opened this issue Jul 9, 2014 · 1 comment
Closed

border-box and padding-bottom kills the posterImage #1335

scottconnerly opened this issue Jul 9, 2014 · 1 comment

Comments

@scottconnerly
Copy link

Problem:
http://codepen.io/scottconnerly/pen/GcAkf
box-sizing: border-box; (very common) in combination with using a padding-bottom (to get responsively sized videos) breaks the poster image, most notably after the video plays. videojs.posterImage.show() fails to show the poster in this case.

Hackney solution:
http://codepen.io/scottconnerly/pen/DKGHE
forcing .video-js to have box-sizing: content-box and then manually setting the height and margin-bottom of the .vjs-poster.

@mmcc
Copy link
Member

mmcc commented Jul 10, 2014

We're still discussing the changes necessary to actually support responsive design if you have any input there: #982

The quick fix I've been telling people to go with is absolute positioning set to the 4 corners, like below, but it looks like your solution works fine as well.

.vjs-poster {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
}

@mmcc mmcc closed this as completed Jul 10, 2014
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants