Skip to content

Commit

Permalink
Reduce video layer size
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtextrem committed Apr 15, 2018
1 parent e32b719 commit 29191a8
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 21 deletions.
51 changes: 37 additions & 14 deletions player.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
@namespace xlink "http://www.w3.org/1999/xlink";

body {
font-family:
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Helvetica,
Arial,
sans-serif,
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol';
}

/*************************************/
/* ЭЛЕМЕНТЫ УПРАВЛЕНИЯ
/*************************************/
Expand Down Expand Up @@ -205,7 +219,7 @@ input:checked + .флажок-значок
/* М_ОКНА
/*************************************/

.окно
.окно.окно
{
position: absolute;
margin: .5rem;
Expand Down Expand Up @@ -249,17 +263,20 @@ body
align-items: stretch;
/* Не показывать прокрутку если перетаскиваемый absolutely positioned element вылезет за пределы проигрывателя */
overflow: hidden;
font: bold .75rem/1.5 Arial, "Helvetica Neue", Helvetica, sans-serif;
font-weight: bold;
font-size: .75rem;
line-height: 1.5;
white-space: nowrap;
color: rgb({{сЦветКнопок}});
fill: currentColor;
text-shadow: 0 .0625rem .0625rem #333;
background: inherit;
-webkit-user-select: none;
}
#проигрыватель:hover > .панель {
will-change: opacity;
}
-webkit-user-select: none;
}

#проигрыватель
{
flex: 1;
Expand All @@ -270,21 +287,22 @@ body
position: relative;
/* Chrome 59 изменяет фон у :fullscreen */
background: inherit;

display: flex;
align-items: center;
justify-content: center;
}
/* Chrome 49 */
/* Chrome 49
#проигрыватель:-webkit-full-screen
{
width: 100%;
height: 100%;
}
}*/
#проигрыватель:fullscreen
{
width: 100%;
height: 100%;
}
#проигрыватель:fullscreen > #глаз {
object-fit: cover;
}
#размерчата:hover,
#размерчата.js-тащилка-элемент
{
Expand Down Expand Up @@ -509,12 +527,17 @@ a:hover
}
#глаз
{
contain: layout style;
position: absolute; /* Chrome 59- */
height: 100%;
width: 100%;
contain: strict;
/* position: absolute; Chrome 59- */
/*height: 100%;
width: 100%;*/
z-index: 1;
object-fit: scale-down;
object-fit: contain;
}
#проигрыватель:fullscreen > #глаз {
contain: layout style;
height: 100% !important;
width: 100% !important;
}
body[data-состояние="8"] #глаз
{
Expand Down
12 changes: 6 additions & 6 deletions player.js
Original file line number Diff line number Diff line change
Expand Up @@ -8533,11 +8533,11 @@ function ЗавершитьРаботу(лБыстро)
})();

function fitVideo() {
const video = document.getElementById('глаз')
const clientRects = video.getBoundingClientRect()
if (video.videoWidth > clientRects.width)
video.style.objectFit = 'fill'
else
video.style.objectFit = 'scale-down'
const video = document.getElementById('глаз'),
vWidth = video.videoWidth,
vHeight = video.videoHeight

video.style.width = vWidth + 'px'
video.style.height = vHeight + 'px'
}
})(window);
2 changes: 1 addition & 1 deletion player_pre.js

Large diffs are not rendered by default.

0 comments on commit 29191a8

Please sign in to comment.