Files
web/packages/design-system/lib/components/VideoPlayer/videoPlayer.module.css
Erik Tiekstra c21aa2dc73 Merged in fix/BOOK-257-video-player (pull request #3373)
Fix/BOOK-257 video player

* fix(BOOK-257): Fixes to VideoPlayerButton and added stories

* fix(BOOK-257): Hiding mute button when the user has interacted with it

* fix(BOOK-257): Added support for poster image

* fix(BOOK-257): add crossOrigin attr to videoplayer

* fix(BOOK-257): comment


Approved-by: Anton Gunnarsson
2025-12-19 12:41:00 +00:00

83 lines
1.3 KiB
CSS

.videoPlayer {
position: relative;
width: 100%;
aspect-ratio: auto;
display: flex;
justify-content: center;
align-items: center;
z-index: 0;
&.inline {
border-radius: var(--Corner-radius-md);
overflow: hidden;
}
&.hero {
height: 100%;
.overlay {
display: contents;
}
.playButton {
position: absolute;
bottom: var(--Space-x2);
right: var(--Space-x2);
}
}
&.hasOverlay::after {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(
180deg,
rgba(255, 255, 255, 0) 0%,
rgba(31, 28, 27, 0.25) 48.08%,
rgba(31, 28, 27, 0.8) 100%
);
}
&.hasError .video {
aspect-ratio: 16 / 9;
}
}
.video {
width: 100%;
height: 100%;
&:not(:fullscreen) {
object-fit: cover;
}
}
.playButton {
position: absolute;
z-index: 1;
}
.muteButton {
position: absolute;
top: var(--Space-x2);
right: var(--Space-x2);
z-index: 1;
}
@media screen and (min-width: 768px) {
.videoPlayer {
&.hero .playButton {
bottom: var(--Space-x4);
right: var(--Space-x4);
}
&.hasOverlay::after {
background: linear-gradient(
180deg,
rgba(255, 255, 255, 0) 0%,
rgba(31, 28, 27, 0.25) 53.8%,
rgba(31, 28, 27, 0.74) 97.6%
);
}
}
}