G
G
Greg Plitt2016-04-21 09:13:32
YouTube
Greg Plitt, 2016-04-21 09:13:32

How to embed video to screen width? HTML5 not rolling??

Hello!
How to embed video in cinema mode? I mean, the format is 16x8, only without the imposed alignment of proportions.
40106692eaa5455aba9621a872208161.png
It is necessary that instead of red, there is either a stretched video (ideally) or a black color (make it yourself using css div table?)
For example, youtube has a button that turns on the video the way I need it:
39e00dbb5da5481aab79f2552647ede4.png
But my video should be I have on the server, should be autorun.
Now the code is like this:

<video width="720" height="300" controls autoplay>
  <source src="/kosmos.mp4 width="100"  type="video/mp4">
  <source src="/kosmos.webm" type="video/webm">
  Сожалею; ваш браузер не поддерживает HTML5 видео в WebM с VP8 или MP4 с H.264.

</video>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lnked, 2016-04-21
@lnked

<div class="video__iframe">
  <video id="video" width="100%" height="auto" controls autoplay loop preload="auto">
    <source src="/kosmos.mp4">
    <source src="/kosmos.webm" type="video/webm">
    <p>Сожалею; ваш браузер не поддерживает HTML5 видео в WebM с VP8 или MP4 с H.264.</p>
  </video>
</div

.video__iframe {
  width: 100%;
  height: 100%;
  position: absolute;
}

.video__iframe video {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    -o-object-fit: cover;
    object-fit: cover;
    min-width: 100%;
    min-height: 100%;
}

G
Greg Plitt, 2016-04-21
@bit24yes

Now, if you insert two videos at once, then the width is what you need,
that's how you can make one video in this format, without black bars.
35410aaa7b5f44bdb55ba0b1bfada3f1.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question