aboutsummaryrefslogtreecommitdiffstats
path: root/src/sass/components/controls.scss
blob: 330c450c5d0e52ecffce3f75f3a6d1577acf24da (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
57
58
59
60
61
62
63
64
65
// --------------------------------------------------------------
// Controls
// --------------------------------------------------------------

// Hide native controls
.plyr--full-ui ::-webkit-media-controls {
  display: none;
}

// Playback controls
.plyr__controls {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  text-align: center;

  .plyr__progress__container {
    flex: 1;
    min-width: 0; // Fix for Edge issue where content would overflow
  }

  // Spacing
  .plyr__controls__item {
    margin-left: calc(#{$plyr-control-spacing} / 4);

    &:first-child {
      margin-left: 0;
      margin-right: auto;
    }

    &.plyr__progress__container {
      padding-left: calc(#{$plyr-control-spacing} / 4);
    }

    &.plyr__time {
      padding: 0 calc(#{$plyr-control-spacing} / 2);
    }

    &.plyr__progress__container:first-child,
    &.plyr__time:first-child,
    &.plyr__time + .plyr__time {
      padding-left: 0;
    }
  }

  // Hide empty controls
  &:empty {
    display: none;
  }
}

// Some options are hidden by default
.plyr [data-plyr='captions'],
.plyr [data-plyr='pip'],
.plyr [data-plyr='airplay'],
.plyr [data-plyr='fullscreen'] {
  display: none;
}

.plyr--captions-enabled [data-plyr='captions'],
.plyr--pip-supported [data-plyr='pip'],
.plyr--airplay-supported [data-plyr='airplay'],
.plyr--fullscreen-enabled [data-plyr='fullscreen'] {
  display: inline-block;
}