From c820fabe342bd03d69c6178a574ff9af37c9d2fd Mon Sep 17 00:00:00 2001 From: Wesley Luyten Date: Tue, 8 Aug 2023 13:32:32 -0500 Subject: [PATCH] feat: add quality selector --- packages/mux-player/src/index.ts | 2 +- .../src/themes/classic/classic.html | 134 +++++++++--------- 2 files changed, 71 insertions(+), 65 deletions(-) diff --git a/packages/mux-player/src/index.ts b/packages/mux-player/src/index.ts index 368295b8b..91d8b8c40 100644 --- a/packages/mux-player/src/index.ts +++ b/packages/mux-player/src/index.ts @@ -1,6 +1,6 @@ import { globalThis, document } from './polyfills'; import { MediaController } from 'media-chrome'; -import 'media-chrome/dist/experimental/media-captions-selectmenu.js'; +import 'media-chrome/dist/experimental/index.js'; import { MediaThemeElement } from 'media-chrome/dist/media-theme-element.js'; import MuxVideoElement, { MediaError, Attributes as MuxVideoAttributes } from '@mux/mux-video'; import { diff --git a/packages/mux-player/src/themes/classic/classic.html b/packages/mux-player/src/themes/classic/classic.html index ed7187280..8eb1a1608 100644 --- a/packages/mux-player/src/themes/classic/classic.html +++ b/packages/mux-player/src/themes/classic/classic.html @@ -19,6 +19,9 @@ --media-preview-time-border-radius: 0 0 2px 2px; --media-preview-time-margin: 0 0 8px; --media-preview-time-text-shadow: none; + --media-listbox-transform-in: translateY(-8px) scale(1); + --media-listbox-transform-out: translateY(-6px) scale(.99); + --media-option-hover-background: rgba(255, 255, 255, 0.28); color: var(--_primary-color); display: inline-block; @@ -59,15 +62,14 @@ cursor: not-allowed; } - :host(:not([audio])) media-captions-selectmenu::part(listbox) { - z-index: 10; + :host(:not([audio])) [part~="listbox"] { + border-radius: 2px; } media-controller:not([mediasubtitleslist]) media-captions-selectmenu { --captions-selectmenu: none; } - /* 0.433s is the transition duration for VTT Regions. * Borrowed here, so the captions don't move too fast. */ media-controller ::slotted([slot='media']) { @@ -80,14 +82,6 @@ --media-webkit-text-track-transition: transform 0.15s ease; } - media-captions-selectmenu { - --media-listbox-background: var(--_secondary-color); - --media-listbox-selected-background: rgba(255, 255, 255, 0.28); - --media-listbox-hover-background: none; - --media-listbox-hover-outline: white solid 1px; - --media-text-color: white; - } - media-volume-range[mediavolumeunavailable] { --volume-range: none; } @@ -355,37 +349,28 @@ - @@ -656,7 +658,8 @@ {{>MuteButton}} {{>VolumeRange}}
- {{>CaptionsMenuButton}} + {{>RenditionSelect}} + {{>CaptionsSelect}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}} @@ -678,7 +681,8 @@ {{>MuteButton}} {{>VolumeRange}}
- {{>CaptionsMenuButton}} + {{>RenditionSelect}} + {{>CaptionsSelect}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}} @@ -698,7 +702,7 @@ {{>PlayButton}} {{>MuteButton}}
- {{>CaptionsMenuButton}} + {{>CaptionsSelect}} {{>FullscreenButton}} @@ -720,7 +724,8 @@ {{>MuteButton}} {{>VolumeRange}}
- {{>CaptionsMenuButton}} + {{>RenditionSelect}} + {{>CaptionsSelect}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}} @@ -745,7 +750,8 @@ {{>MuteButton}} {{>VolumeRange}}
- {{>CaptionsMenuButton}} + {{>RenditionSelect}} + {{>CaptionsSelect}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}}