Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mux-player): allow forcibly showing buttons that we usually hide…
… at small sizes (#827) ### Description This feature adds "opt in" controls to the "gerwig" (default 2023) Mux Player theme via CSS. This applies to the "extra small" UI (<470px width). To "opt in", you must set the relevant display CSS variable from its default (`none`) to `inline-flex`. The most relevant variables are: - `--time-display` - `--playback-rate-selectmenu` - `--pip-button` While there are "center controls" for play/seek back/seek forward, you may also "opt in" to showing those in the control bar via: - `--play-button` - `--seek-backward-button` - `--seek-forward-button` **NOTE:** "Under the hood," the gerwig theme actually relies on the more specific "bottom" CSS vars (e.g. `--bottom-time-display`). Due to CSS precedence rules, setting these values will be harder, as the theme-based CSS selector may have a higher precedence than the externally defined/"app level" CSS selector. For example, simply setting the CSS variable via an inline style for `<mux-player>` will have a lower precedence. Hence, it's recommended to use the more generic CSS vars. **NOTE:** I also added some missing CSS vars that I caught while working on the impl. ### To Test Use the nextjs MuxPlayer demo page to load a video and configure it to render "extra small" via the config UI. 1. Confirm that the UI does not show any controls that shouldn't show up for the extra small UI. 2. Use dev tools to apply the aforementioned CSS variables and `inline-flex` value as e.g. an inline style for the `<mux-player>` instance. Confirm the controls now show up. --------- Co-authored-by: Christian Pillsbury <[email protected]>
- Loading branch information
f7200e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
elements-demo-create-react-app – ./examples/create-react-app-with-typescript
elements-demo-create-react-app-mux.vercel.app
elements-demo-create-react-app.vercel.app
elements-demo-create-react-app-git-main-mux.vercel.app
f7200e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
elements-demo-vanilla – ./examples/vanilla-ts-esm
elements-demo-vanilla-git-main-mux.vercel.app
elements-demo-vanilla.vercel.app
elements-demo-vanilla-mux.vercel.app
f7200e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
elements-demo-vue – ./examples/vue-with-typescript
elements-demo-vue-git-main-mux.vercel.app
elements-demo-vue.vercel.app
elements-demo-vue-mux.vercel.app
f7200e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
elements-demo-nextjs – ./examples/nextjs-with-typescript
elements-demo-nextjs.vercel.app
elements-demo-nextjs-mux.vercel.app
elements-demo-nextjs-git-main-mux.vercel.app
f7200e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
elements-demo-svelte-kit – ./examples/svelte-kit
elements-demo-svelte-kit.vercel.app
elements-demo-svelte-kit-mux.vercel.app
elements-demo-svelte-kit-git-main-mux.vercel.app