M
M
Millerish2016-07-26 15:56:46
css
Millerish, 2016-07-26 15:56:46

Html 5 video how to make a video for the whole block?

Good afternoon!

I need to make html 5 video for the entire block (whatever without black indents at the top / bottom or on the sides). 100% width and height of the player itself does not help, i.e. videos of different formats, the player itself stretches, but the video has black stripes either from the top / bottom or on the sides.

How to solve my issue?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2016-07-26
@Millerish

<div class="b-video">
  <video class="viedeo__file"preload="auto" autoplay="true" loop="loop" muted="muted" volume="0" poster="img/slide.png" id="video">
        <source src="http://site.ru/video/1.mp4" type="video/mp4" id="source-video">
    </video>
</div>


<style>
  .b-video {
      width: 100%;
      min-height: 600px;
      height: 100vh;
      position: relative;
      overflow: hidden;
      z-index: 1;
}
.viedeo__file{
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
</style>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question