Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

3.9 KB
Raw Blame
/* Change all text and icon colors in the player. */
.vjs-owncast {
  .video-js {
    color: var(--theme-color-components-text-on-light);
  }

  .vjs-volume-bar.vjs-slider-horizontal {
    width: 100px;
    flex-shrink: 0;
  }

  .vjs-hover.vjs-volume-panel-horizontal {
    // vjs default is 5em icon+padding + 5em slider.
    // should match the value above.
    width: calc(5em + 100px) !important;
  }

  .vjs-menu li {
    color: var(--theme-color-components-text-on-dark);
  }

  .vjs-big-play-button {
    z-index: 10;
    color: var(--theme-color-action);

    // Setting the font size resizes the video.js
    // BigPlayButton due to its style definitions
    // (see https://github.com/videojs/video.js/blob/b306ce614e70e6d3305348d1b69e1434031d73ef/src/css/components/_big-play.scss)
    // 30vmin determined by trial & error to not cause
    // overflow with weird (small) x or y dimensions.
    // min and max are also arbitrary; max was the old
    // constant value. feel free to change if necessary,
    // but check short and narrow screen sizes for overflow
    // issues.
    font-size: clamp(1rem, 30vmin, 8rem) !important;
    border-color: transparent !important;
    border-radius: var(--theme-rounded-corners) !important;
    background-color: transparent !important;
    text-shadow: 2px 3px 4px #0000005f;
    -webkit-text-stroke: 2px white;

    :hover {
      transition: all 0.2s ease-in-out;
      font-size: 10rem;
      text-shadow: 2px 5px 4px #00000093;
    }
  }

  // Big unmute affordance shown while the stream autoplays muted. It fills the
  // whole player frame so clicking anywhere unmutes, with the muted-speaker
  // icon (antd MutedFilled, injected as inline SVG in OwncastPlayer) centered
  // and drawn in the action color like the big play button. It sits below the
  // control bar (z-index) so the controls stay usable, and is its own class
  // because video.js force hides .vjs-big-play-button once playback has
  // started. Visibility is toggled in OwncastPlayer.
  .vjs-big-unmute-button.vjs-control {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: transparent;
    color: var(--theme-color-action);
    cursor: pointer;

    .vjs-icon-placeholder {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .vjs-icon-placeholder svg {
      width: clamp(2rem, 30vmin, 9rem);
      height: auto;

      // fill is currentColor, so the theme action color set on the button
      // flows into the glyph.
      filter: drop-shadow(2px 6px 22px #000000e6) drop-shadow(0 2px 8px #000c);
      transform-origin: center center;
      transition:
        transform 0.2s ease-in-out,
        filter 0.2s ease-in-out;
    }

    &:hover .vjs-icon-placeholder svg {
      transform: scale(1.25);
      filter: drop-shadow(2px 9px 30px #000000f2) drop-shadow(0 3px 12px #000000e6);
    }

    &.vjs-hidden {
      display: none;
    }
  }

  .vjs-loading-spinner {
    z-index: 10;
    display: block;
    color: var(--theme-color-components-text-on-light);
  }

  .vjs-control-bar {
    color: var(--theme-color-components-text-on-light);
    background-color: var(--theme-color-background-main) !important;
    z-index: 2;
  }

  .vjs-control {
    color: var(--theme-color-components-text-on-light);
  }
}

.vjs-airplay {
  .vjs-icon-placeholder::before {
    content: url('../airplay.svg');
    width: 50% !important;
    height: 50% !important;
    top: 15% !important;
    left: 15% !important;
  }
}

.vjs-quality-selector {
  .vjs-icon-placeholder {
    font-family: VideoJS, serif;
    font-weight: 400;
    font-style: normal;

    &::before {
      content: '\f114';
    }
  }
}

.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder {
  color: var(--theme-color-components-video-live-indicator) !important;
}