aboutsummaryrefslogtreecommitdiffstats
path: root/src/sass/components/video.scss
blob: 06b2848d6139f0729fe18cb76f0df57ef1348c1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// --------------------------------------------------------------
// Video styles
// --------------------------------------------------------------

.plyr--video {
    background: #000;
    overflow: hidden;

    // Menu open
    &.plyr--menu-open {
        overflow: visible;
    }
}

.plyr__video-wrapper {
    background: #000;
    border-radius: inherit;
    height: 100%;
    overflow: hidden;
    position: relative;
    // Require z-index to force border-radius
    z-index: 0;
}

// Default to 16:9 ratio but this is set by JavaScript based on config
$embed-padding: ((100 / 16) * 9);

.plyr__video-embed,
.plyr__video-wrapper--fixed-ratio {
    height: 0;
    padding-bottom: to-percentage($embed-padding);
}

.plyr__video-embed iframe,
.plyr__video-wrapper--fixed-ratio video {
    border: 0;
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    user-select: none;
    width: 100%;
}

// If the full custom UI is supported
.plyr--full-ui .plyr__video-embed {
    $height: 240;
    $offset: to-percentage(($height - $embed-padding) / ($height / 50));

    // Only used for Vimeo
    > .plyr__video-embed__container {
        padding-bottom: to-percentage($height);
        position: relative;
        transform: translateY(-$offset);
    }
}