From 2db6be75be82b853f4845dee0185804aadcbe301 Mon Sep 17 00:00:00 2001 From: Darius Cepulis Date: Wed, 4 Mar 2026 11:14:41 -0600 Subject: [PATCH] fix(site): reset installation guide to implemented features (#707) Co-authored-by: Claude Opus 4.6 --- .../installation/HTMLCdnCodeBlock.tsx | 15 +- .../installation/HTMLInstallTabs.tsx | 8 +- .../installation/HTMLUsageCodeBlock.tsx | 69 +++--- .../installation/ReactCreateCodeBlock.tsx | 73 +++--- .../installation/ReactUsageCodeBlock.tsx | 22 +- .../installation/RendererSelect.tsx | 41 ++-- .../{architecture.mdx => _architecture.mdx} | 0 .../docs/concepts/{skins.mdx => _skins.mdx} | 0 .../{ui-components.mdx => _ui-components.mdx} | 0 .../docs/concepts/under-construction.mdx | 6 - .../src/content/docs/concepts/v10-roadmap.mdx | 22 +- ...stomize-skins.mdx => _customize-skins.mdx} | 0 site/src/content/docs/how-to/installation.mdx | 8 +- site/src/docs.config.ts | 20 +- site/src/stores/installation.ts | 33 +-- .../__tests__/detect-renderer.test.ts | 226 +----------------- .../src/utils/installation/detect-renderer.ts | 131 +++++----- 17 files changed, 211 insertions(+), 463 deletions(-) rename site/src/content/docs/concepts/{architecture.mdx => _architecture.mdx} (100%) rename site/src/content/docs/concepts/{skins.mdx => _skins.mdx} (100%) rename site/src/content/docs/concepts/{ui-components.mdx => _ui-components.mdx} (100%) delete mode 100644 site/src/content/docs/concepts/under-construction.mdx rename site/src/content/docs/how-to/{customize-skins.mdx => _customize-skins.mdx} (100%) diff --git a/site/src/components/installation/HTMLCdnCodeBlock.tsx b/site/src/components/installation/HTMLCdnCodeBlock.tsx index 4c7a7f49..da2461da 100644 --- a/site/src/components/installation/HTMLCdnCodeBlock.tsx +++ b/site/src/components/installation/HTMLCdnCodeBlock.tsx @@ -9,22 +9,25 @@ function getSkinImportParts(skin: Skin): { group: string; skinFile: string } { return { group: skin, skinFile: 'skin' }; } +// jsdelivr doesn't resolve Node package exports, so we use the full file path +const CDN_BASE = 'https://cdn.jsdelivr.net/npm/@videojs/html@next/dist/default/define'; + function generateCdnCode(useCase: UseCase, skin: Skin): string { if (useCase === 'background-video') { return ` -`; +`; } const { group, skinFile } = getSkinImportParts(skin); return ` -`; +`; } export default function HTMLCdnCodeBlock() { diff --git a/site/src/components/installation/HTMLInstallTabs.tsx b/site/src/components/installation/HTMLInstallTabs.tsx index be6d9f26..aaffb8e2 100644 --- a/site/src/components/installation/HTMLInstallTabs.tsx +++ b/site/src/components/installation/HTMLInstallTabs.tsx @@ -48,16 +48,16 @@ export default function HTMLInstallTabs() { - + - + - + - + diff --git a/site/src/components/installation/HTMLUsageCodeBlock.tsx b/site/src/components/installation/HTMLUsageCodeBlock.tsx index 9af0538d..85252d39 100644 --- a/site/src/components/installation/HTMLUsageCodeBlock.tsx +++ b/site/src/components/installation/HTMLUsageCodeBlock.tsx @@ -2,25 +2,25 @@ import { useStore } from '@nanostores/react'; import ClientCode from '@/components/Code/ClientCode'; import { Tab, TabsList, TabsPanel, TabsRoot } from '@/components/Tabs'; import type { Renderer, Skin, UseCase } from '@/stores/installation'; -import { installMethod, muxPlaybackId, renderer, skin, sourceUrl, useCase } from '@/stores/installation'; +import { installMethod, renderer, skin, sourceUrl, useCase } from '@/stores/installation'; function getRendererTag(renderer: Renderer): string { const map: Record = { 'background-video': 'background-video', - cloudflare: 'cloudflare-video', - dash: 'dash-video', + // cloudflare: 'cloudflare-video', + // dash: 'dash-video', hls: 'hls-video', 'html5-audio': 'audio', 'html5-video': 'video', - jwplayer: 'jwplayer-video', - 'mux-audio': 'mux-audio', - 'mux-background-video': 'mux-background-video', - 'mux-video': 'mux-video', + // jwplayer: 'jwplayer-video', + // 'mux-audio': 'mux-audio', + // 'mux-background-video': 'mux-background-video', + // 'mux-video': 'mux-video', // shaka: 'shaka-video', - spotify: 'spotify-audio', - vimeo: 'vimeo-video', - wistia: 'wistia-video', - youtube: 'youtube-video', + // spotify: 'spotify-audio', + // vimeo: 'vimeo-video', + // wistia: 'wistia-video', + // youtube: 'youtube-video', }; return map[renderer]; } @@ -42,34 +42,22 @@ function getSkinTag(useCase: UseCase, skin: Skin): string { const map: Record = { video: 'video-skin', audio: 'audio-skin', - 'minimal-video': 'minimal-video-skin', - 'minimal-audio': 'minimal-audio-skin', + 'minimal-video': 'video-minimal-skin', + 'minimal-audio': 'audio-minimal-skin', }; return map[skin]; } -function getRendererElement(renderer: Renderer, playbackId: string | null, url: string): string { +function getRendererElement(renderer: Renderer, url: string): string { const tag = getRendererTag(renderer); - - // When renderer is a mux variant and we have a playback ID, use playback-id attribute - if ((renderer === 'mux-video' || renderer === 'mux-audio' || renderer === 'mux-background-video') && playbackId) { - return `<${tag} playback-id="${playbackId}">`; - } - const src = url.trim() || '...'; return `<${tag} src="${src}">`; } -function generateHTMLCode( - useCase: UseCase, - skin: Skin, - renderer: Renderer, - playbackId: string | null, - url: string -): string { +function generateHTMLCode(useCase: UseCase, skin: Skin, renderer: Renderer, url: string): string { const providerTag = getProviderTag(useCase); const skinTag = getSkinTag(useCase, skin); - const rendererElement = getRendererElement(renderer, playbackId, url); + const rendererElement = getRendererElement(renderer, url); return `