G
G
Gagatyn2018-08-20 23:07:47
YouTube
Gagatyn, 2018-08-20 23:07:47

How to adjust the poster and your cover to the youtube video?

Hello! Can't get past the video bug. Website
There is a video on the main page. The cover is set by background'om + poster, well, to show your covers. How to achieve a universal solution so that the cover or the video container itself is the same size and nothing peeks out, even if the cover size is changed?
I tried doing

.videoWrapper {
  position: relative;
  padding-bottom: 56.25%;
  padding-top: 25px;
  height: 0;
}
.videoWrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

}

Does not help. I tried to calculate from the picture (cover). I created an object with the help of js new Image()and calculated by size, maybe the right solution, but it didn’t work because of crooked hands. I can't think of what to do.
When you click on the video thumbnails next to the main video, a window with the video appears, the same thing is there.
And the video grid, the covers are cut due to the small size.
Tell me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zoozag, 2018-09-07
@zoozag

background-size: cover;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question