Skip to content
This repository was archived by the owner on Oct 21, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
bc85f96
docs(site): add the vidstack migration guide
mihar-22 Sep 29, 2026
ba0f451
docs(site): document keep-alive on the player reference
mihar-22 Sep 29, 2026
71d1864
docs(site): set the vidstack security window and run init in the agen…
mihar-22 Sep 29, 2026
a8a5d68
docs(site): drop skin switches from the vidstack known gaps
mihar-22 Sep 29, 2026
78ff050
docs(site): show the vidstack agent prompt in the ai quickstart card
mihar-22 Sep 29, 2026
01a474d
docs(site): lazy-load media components in the vidstack url recipe
mihar-22 Sep 29, 2026
58d2d2c
docs(site): link vidstack parity issues in the guide
mihar-22 Sep 29, 2026
ea3b36c
docs(site): link programmatic chapters in the vidstack guide
mihar-22 Sep 29, 2026
7edd70b
docs(site): type engine access with instanceof in the vidstack guide
mihar-22 Sep 29, 2026
c0408a4
docs(site): update the vidstack guide for the aligned store api
mihar-22 Sep 30, 2026
3375111
docs(site): correct the vidstack guide after a fact-check sweep
mihar-22 Sep 30, 2026
4a9a92b
docs(site): subscribe to an existing engine too in the vidstack guide
mihar-22 Sep 30, 2026
410afbb
feat(site): collapse long agent prompts like code blocks
mihar-22 Sep 30, 2026
e632a4d
docs(site): describe where the vidstack prompt reads docs from
mihar-22 Sep 30, 2026
bf3db24
docs(site): pick the vidstack media with resolveAdapterType
mihar-22 Sep 30, 2026
254c723
docs(site): say where the vidstack guide's engine imports come from
mihar-22 Oct 1, 2026
17b42b1
docs(site): list vidstack with the other migration guides in the beta…
mihar-22 Oct 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions site/integrations/llms-markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,10 @@ export function generateDocsIndex(

content += `> The \`video.js\` package on npm is still Video.js 8. Video.js 10 ships as \`@videojs/${framework}\`; to move existing Video.js 8 code, read ${siteUrl}/docs/framework/${framework}/guides/migrate-from-video-js-8.md\n\n`;

const vidstackPackage = framework === 'react' ? '@vidstack/react' : 'vidstack';

content += `> Vidstack Player is in security-only maintenance. To move existing \`${vidstackPackage}\` code, read ${siteUrl}/docs/framework/${framework}/guides/migrate-from-vidstack.md\n\n`;

content += `> Print version-matched installation options without changing files: \`npx @videojs/cli agents init\`, then pass \`--framework ${framework}\` with the other choices. Installation guide index: ${siteUrl}/docs/guides/installation.md\n\n`;

// Get sidebar filtered for this framework (production only)
Expand Down
3 changes: 3 additions & 0 deletions site/integrations/tests/llms-markdown.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ describe('generateDocsIndex', () => {
expect(index).toContain(
'> The `video.js` package on npm is still Video.js 8. Video.js 10 ships as `@videojs/html`; to move existing Video.js 8 code, read https://videojs.org/docs/framework/html/guides/migrate-from-video-js-8.md\n'
);
expect(index).toContain(
'> Vidstack Player is in security-only maintenance. To move existing `vidstack` code, read https://videojs.org/docs/framework/html/guides/migrate-from-vidstack.md\n'
);
expect(index).toContain(
'## Guides\n\n' +
'Installation, migration, concepts, playback guides, customization, and tooling for Video.js.\n\n' +
Expand Down
13 changes: 9 additions & 4 deletions site/src/components/AgentPrompt.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import CollapsibleCode from '@/components/CollapsibleCode';
import CopyButton from '@/components/CopyButton';
import P from '@/components/typography/P.astro';

Expand All @@ -15,10 +16,14 @@ const { prompt } = Astro.props;
class="mx-auto my-6 max-w-3xl overflow-hidden rounded-xl corner-squircle border border-line bg-surface shadow-xs"
data-agent-prompt-card
>
<pre class="m-0 overflow-x-auto whitespace-pre-wrap wrap-anywhere bg-soot p-5"><code
class="font-mono text-code leading-relaxed text-manila-light"
data-agent-prompt>{prompt}</code
></pre>
<div class="relative bg-soot">
<CollapsibleCode client:idle fadeClassName="from-soot" scrollTarget="[data-agent-prompt-card]">
<pre class="m-0 overflow-x-auto whitespace-pre-wrap wrap-anywhere bg-soot p-5"><code
class="font-mono text-code leading-relaxed text-manila-light"
data-agent-prompt>{prompt}</code
></pre>
</CollapsibleCode>
</div>
<div class="flex justify-end border-t border-line bg-surface-raised p-3" data-llms-ignore>
<CopyButton
client:idle
Expand Down
128 changes: 128 additions & 0 deletions site/src/components/CollapsibleCode.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import clsx from 'clsx';
import { type ReactNode, useEffect, useRef, useState } from 'react';

import ChevronDown from '@/assets/icons/chevron-down.svg?react';

import type { TabsVariant } from './Tabs';

/**
* Collapsed height for long code. Content that only slightly exceeds the cap is shown in full, since a "Show more"
* button that reveals a couple of lines is more annoying than the extra height.
*/
const COLLAPSED_MAX_HEIGHT = 512;
const COLLAPSE_SLACK = 96;

interface CollapsibleCodeProps {
children: ReactNode;
/** Classes for the element that holds the content and collapses. */
className?: string;
/** Whether the content is shown. Hidden content has no layout, so it's measured once shown. */
active?: boolean;
variant?: TabsVariant;
/** Where the fade over collapsed content starts, when the content's background isn't the code frame's. */
fadeClassName?: string;
/** The ancestor to bring back into view when collapsing from below it. Defaults to the content itself. */
scrollTarget?: string;
}

/**
* Caps long code at a fixed height with "Show more" and "Show less" controls, as code frames do. Render it inside a
* positioned element, since the fade and its button sit over the bottom edge of the content.
*/
export default function CollapsibleCode({
children,
className,
active = true,
variant = 'compact',
fadeClassName,
scrollTarget,
}: CollapsibleCodeProps) {
const contentRef = useRef<HTMLDivElement>(null);
const [overflows, setOverflows] = useState(false);
const [expanded, setExpanded] = useState(false);

// The content's natural height decides whether the collapse affordance is needed at all.
useEffect(() => {
const content = contentRef.current;
if (!active || !content) return;

const measure = () => setOverflows(content.scrollHeight > COLLAPSED_MAX_HEIGHT + COLLAPSE_SLACK);

measure();
const observer = new ResizeObserver(measure);

observer.observe(content);

return () => {
observer.disconnect();
};
}, [active]);

const collapsed = overflows && !expanded;

const onCollapse = () => {
setExpanded(false);

// Collapsing from the bottom of a long block would otherwise leave the reader below it.
const content = contentRef.current;
const root = scrollTarget ? content?.closest(scrollTarget) : content;

if (root && root.getBoundingClientRect().top < 0) root.scrollIntoView({ block: 'start' });
};

const buttonClassName = clsx(
'flex items-center gap-1.5 h-7 pl-2.5 pr-3 rounded-full corner-squircle text-p3 font-medium cursor-pointer select-none',
variant === 'compact'
? 'bg-warm-gray text-manila-light border border-manila-light/15 intent:border-manila-light/30'
: 'bg-surface-raised border border-line intent:border-line-strong'
);

return (
<>
<div
ref={contentRef}
className={clsx(className, collapsed && 'overflow-y-hidden')}
style={collapsed ? { maxHeight: COLLAPSED_MAX_HEIGHT } : undefined}
>
{children}
</div>
{collapsed && (
<div
className={clsx(
'pointer-events-none absolute inset-x-0 bottom-0 flex h-28 items-end justify-center pb-4 bg-linear-to-t to-transparent',
fadeClassName ??
(variant === 'compact' ? 'from-faded-black dark:from-soot' : 'from-manila-light dark:from-faded-black')
)}
data-copy-ignore
data-search-ignore
data-llms-ignore
>
<button
type="button"
className={clsx(buttonClassName, 'pointer-events-auto')}
onClick={() => setExpanded(true)}
>
<ChevronDown className="size-4" />
Show more
</button>
</div>
)}
{overflows && expanded && (
<div
className={clsx(
'flex justify-center border-t py-3',
variant === 'compact' ? 'border-manila-light/10 dark:border-line' : 'border-line'
)}
data-copy-ignore
data-search-ignore
data-llms-ignore
>
<button type="button" className={buttonClassName} onClick={onCollapse}>
<ChevronDown className="size-4 rotate-180" />
Show less
</button>
</div>
)}
</>
);
}
96 changes: 8 additions & 88 deletions site/src/components/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import clsx from 'clsx';
import { useEffect, useId, useRef, useState } from 'react';

import Check from '@/assets/icons/check.svg?react';
import ChevronDown from '@/assets/icons/chevron-down.svg?react';
import CopyIcon from '@/assets/icons/copy.svg?react';
import { twMerge } from '@/utils/twMerge';
import useIsHydrated from '@/utils/useIsHydrated';

import CollapsibleCode from './CollapsibleCode';
import CopyButton from './CopyButton';

export type TabsVariant = 'expanded' | 'compact';
Expand Down Expand Up @@ -277,20 +277,10 @@ interface TabsPanelProps {
variant?: TabsVariant;
}

/**
* Collapsed height for long code. Content that only slightly exceeds the cap is shown in full, since a "Show more"
* button that reveals a couple of lines is more annoying than the extra height.
*/
const COLLAPSED_MAX_HEIGHT = 512;
const COLLAPSE_SLACK = 96;

export function TabsPanel({ value, children, initial, className, variant = 'compact' }: TabsPanelProps) {
const ref = useRef<HTMLDivElement>(null);
const contentRef = useRef<HTMLDivElement>(null);
const [isActive, setIsActive] = useState(initial);
const [ids, setIds] = useState<{ id: string; labelledBy: string } | null>(null);
const [overflows, setOverflows] = useState(false);
const [expanded, setExpanded] = useState(false);

useEffect(() => {
const base = ref.current?.closest('[data-tabs-root]')?.getAttribute('data-tabs-id');
Expand Down Expand Up @@ -323,42 +313,6 @@ export function TabsPanel({ value, children, initial, className, variant = 'comp
};
}, [value]);

// A hidden panel has no layout, so measure once it is shown. The content's natural height decides whether the
// collapse affordance is needed at all.
useEffect(() => {
const content = contentRef.current;
if (!isActive || !content) return;

const measure = () => setOverflows(content.scrollHeight > COLLAPSED_MAX_HEIGHT + COLLAPSE_SLACK);

measure();
const observer = new ResizeObserver(measure);

observer.observe(content);

return () => {
observer.disconnect();
};
}, [isActive]);

const collapsed = overflows && !expanded;

const onCollapse = () => {
setExpanded(false);

// Collapsing from the bottom of a long block would otherwise leave the reader below the frame.
const root = ref.current?.closest('[data-tabs-root]');

if (root && root.getBoundingClientRect().top < 0) root.scrollIntoView({ block: 'start' });
};

const buttonClassName = clsx(
'flex items-center gap-1.5 h-7 pl-2.5 pr-3 rounded-full corner-squircle text-p3 font-medium cursor-pointer select-none',
variant === 'compact'
? 'bg-warm-gray text-manila-light border border-manila-light/15 intent:border-manila-light/30'
: 'bg-surface-raised border border-line intent:border-line-strong'
);

return (
<div
ref={ref}
Expand All @@ -369,49 +323,15 @@ export function TabsPanel({ value, children, initial, className, variant = 'comp
data-value={value}
className={twMerge(clsx('relative flex-1 min-h-0'), className)}
>
<div
ref={contentRef}
className={clsx('overflow-x-auto scrollbar-thin px-7 py-5', collapsed && 'overflow-y-hidden')}
style={collapsed ? { maxHeight: COLLAPSED_MAX_HEIGHT } : undefined}
{/* A hidden panel has no layout, so it's measured once it's shown. */}
<CollapsibleCode
active={Boolean(isActive)}
variant={variant}
className="scrollbar-thin overflow-x-auto px-7 py-5"
scrollTarget="[data-tabs-root]"
>
{children}
</div>
{collapsed && (
<div
className={clsx(
'pointer-events-none absolute inset-x-0 bottom-0 flex h-28 items-end justify-center pb-4 bg-linear-to-t to-transparent',
variant === 'compact' ? 'from-faded-black dark:from-soot' : 'from-manila-light dark:from-faded-black'
)}
data-copy-ignore
data-search-ignore
data-llms-ignore
>
<button
type="button"
className={clsx(buttonClassName, 'pointer-events-auto')}
onClick={() => setExpanded(true)}
>
<ChevronDown className="size-4" />
Show more
</button>
</div>
)}
{overflows && expanded && (
<div
className={clsx(
'flex justify-center border-t py-3',
variant === 'compact' ? 'border-manila-light/10 dark:border-line' : 'border-line'
)}
data-copy-ignore
data-search-ignore
data-llms-ignore
>
<button type="button" className={buttonClassName} onClick={onCollapse}>
<ChevronDown className="size-4 rotate-180" />
Show less
</button>
</div>
)}
</CollapsibleCode>
</div>
);
}
3 changes: 2 additions & 1 deletion site/src/components/docs/MigrationAgentStart.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AgentPrompt from '@/components/AgentPrompt.astro';
import { DEFAULT_FRAMEWORK, resolveDocsFramework } from '@/types/docs';

interface Props {
source: 'video-js-8' | 'media-chrome' | 'mux-player' | 'plyr';
source: 'video-js-8' | 'media-chrome' | 'mux-player' | 'plyr' | 'vidstack';
}

const { source } = Astro.props;
Expand All @@ -14,6 +14,7 @@ const names = {
'media-chrome': 'Media Chrome',
'mux-player': 'Mux Player',
plyr: 'Plyr',
vidstack: 'Vidstack',
};
const framework = resolveDocsFramework(Astro.params.framework) ?? DEFAULT_FRAMEWORK;
const packageName = framework === 'react' ? '@videojs/react' : '@videojs/html';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const guide = framework ? `${FRAMEWORK_LABELS[framework]} migration guide` : 'mi
>, <DocsLink slug="guides/migrate-from-mux-player" framework={framework}>Mux Player</DocsLink>, <DocsLink
slug="guides/migrate-from-plyr"
framework={framework}>Plyr</DocsLink
>, or <DocsLink slug="guides/migrate-from-media-chrome" framework={framework}>Media Chrome</DocsLink>. Each maps your
>, <DocsLink slug="guides/migrate-from-media-chrome" framework={framework}>Media Chrome</DocsLink>, or <DocsLink
slug="guides/migrate-from-vidstack"
framework={framework}>Vidstack</DocsLink
>. Each maps your
existing setup onto Video.js v10 instead of starting from scratch.
</Aside>
Loading
Loading