From c6a34343f4acfc4242dd0f871bbd3f802b21fa90 Mon Sep 17 00:00:00 2001 From: Adam Jaggard Date: Tue, 1 Aug 2023 16:55:10 +0100 Subject: [PATCH] chore: Prepare default theme from Mux Player for export (#668) The goal of this PR is to package the existing default theme such that it can be exported as it's own module. This can then be easily swapped out in the future with a new theme. Theme source files now reside in `src/themes` (themes based in this repo and re-exported from media chrome). Build artefacts for themes are in `dist/themes`. --------- Co-authored-by: Gary Katsevman Co-authored-by: Christian Pillsbury --- examples/svelte-kit/src/routes/+page.svelte | 1 + .../src/routes/mux-player-theme/+page.svelte | 44 ++++++++++++++++++ .../public/mux-player-theme.html | 2 +- .../src/mux-player-microvideo-theme.ts | 1 + packages/mux-player/.gitignore | 2 + packages/mux-player/package.json | 27 +++++++++-- packages/mux-player/scripts/build-themes.mjs | 46 +++++++++++++++++++ packages/mux-player/src/index.ts | 6 ++- packages/mux-player/src/template.ts | 10 +--- .../classic/classic.html} | 2 +- .../mux-player/src/themes/classic/index.ts | 17 +++++++ .../themes/microvideo/index.ts} | 0 .../themes/minimal/index.ts} | 0 13 files changed, 141 insertions(+), 17 deletions(-) create mode 100644 examples/svelte-kit/src/routes/mux-player-theme/+page.svelte create mode 100644 examples/vanilla-ts-esm/src/mux-player-microvideo-theme.ts create mode 100644 packages/mux-player/.gitignore create mode 100644 packages/mux-player/scripts/build-themes.mjs rename packages/mux-player/src/{media-theme-mux.html => themes/classic/classic.html} (99%) create mode 100644 packages/mux-player/src/themes/classic/index.ts rename packages/mux-player/{themes/microvideo.js => src/themes/microvideo/index.ts} (100%) rename packages/mux-player/{themes/minimal.js => src/themes/minimal/index.ts} (100%) diff --git a/examples/svelte-kit/src/routes/+page.svelte b/examples/svelte-kit/src/routes/+page.svelte index b72f8cce4..194d38e8f 100644 --- a/examples/svelte-kit/src/routes/+page.svelte +++ b/examples/svelte-kit/src/routes/+page.svelte @@ -11,5 +11,6 @@
  • <mux-video>
  • <mux-audio>
  • <mux-player>
  • +
  • <mux-player> (theme)
  • diff --git a/examples/svelte-kit/src/routes/mux-player-theme/+page.svelte b/examples/svelte-kit/src/routes/mux-player-theme/+page.svelte new file mode 100644 index 000000000..c628ea602 --- /dev/null +++ b/examples/svelte-kit/src/routes/mux-player-theme/+page.svelte @@ -0,0 +1,44 @@ + + + + + + + + + + +Browse Elements diff --git a/examples/vanilla-ts-esm/public/mux-player-theme.html b/examples/vanilla-ts-esm/public/mux-player-theme.html index b8b623dc0..3aaf40350 100644 --- a/examples/vanilla-ts-esm/public/mux-player-theme.html +++ b/examples/vanilla-ts-esm/public/mux-player-theme.html @@ -9,7 +9,7 @@ defer src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1" > - +