Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 0 additions & 20 deletions apps/sandbox/app/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
@source "../app";
@source "../templates";
@source "./_generated/registry";
/*
* The publisher's Tailwind skin predates VJSC and is not in the generated registry. Its class maps ship bundled inside
* the public packages, so scan those copies. Keep these paths narrow: scanning either package root follows workspace
* symlinks across thousands of generated files and blocks cold requests.
*/
@source "../node_modules/@videojs/html/dist/default/presets/publisher";
@source "../node_modules/@videojs/react/dist/default/presets/publisher";

/* The shell's scheme control pins `data-color-scheme`; without it the operating system decides. */
:root {
Expand Down Expand Up @@ -40,19 +33,6 @@

@theme {
--font-sans: Inter, ui-sans-serif, system-ui, sans-serif;
/* Publisher Tailwind skin animation token; ejected from the publisher's legacy skin `shared/tailwind.css`. */
--animate-media-pulse: media-pulse 2s ease-in-out infinite;
}

/* Soft opacity pulse for live/connecting status dots (publisher skins). */
@keyframes media-pulse {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.4;
}
}

@layer base {
Expand Down
33 changes: 25 additions & 8 deletions apps/sandbox/templates/moq-publisher-react/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import '@app/styles.css';
// ?real publish to an actual MoQ relay via <MoqPublishVideo>
// ?relay=<url> relay endpoint for ?real (default https://relay.mux.dev)
// ?ns=<namespace> publish namespace for ?real (default: random name)
// ?styling=tailwind use the Tailwind skin twin
// ?styling=tailwind compile the skin's Tailwind styling from its authored source
import { SandboxI18nProvider } from '@app/shared/react/sandbox-i18n';
import type { Styling } from '@app/types';
import { createPlayer, useComposedRefs, useMediaInstance } from '@videojs/react';
import { MoqPublishVideo, PublisherSkin, PublisherSkinTailwind, publisherFeatures } from '@videojs/react/publisher';
import { MoqPublishVideo, PublisherSkin, publisherFeatures } from '@videojs/react/publisher';
import { type ComponentProps, forwardRef, useCallback } from 'react';
import { createRoot } from 'react-dom/client';

Expand All @@ -28,9 +28,28 @@ const real = params.has('real');
const relay = params.get('relay') || 'https://relay.mux.dev';
const namespace = params.get('ns') || `vjs-sandbox-${Math.random().toString(36).slice(2, 8)}`;

if (styling === 'css') await import('@videojs/react/publisher/skin.css');
/**
* The packages ship only the CSS skin, so Tailwind compiles the authored source on request, as the shell does for the
* playback skins.
*/
async function loadSkin(): Promise<typeof PublisherSkin> {
if (styling === 'css') {
await import('@videojs/react/publisher/skin.css');

return PublisherSkin;
}

const [authored] = await Promise.all([
import('../../../../packages/skins/src/presets/publisher/skin.tsx?style=tailwind&target=react&skin=default-publisher&theme=default'),
import('@app/styles.authored.css'),
]);

const { Provider } = createPlayer({ features: publisherFeatures });
return authored.PublisherSkin;
}

const Skin = await loadSkin();

const { Player } = createPlayer({ features: publisherFeatures });

/**
* Fake twin of `MoqPublishVideo` — the same preview `<video>` wired to `FakePublishMedia` (real capture, simulated
Expand All @@ -51,15 +70,13 @@ const FakePublishVideo = forwardRef<HTMLVideoElement, ComponentProps<'video'>>(f
});

function App() {
const Skin = styling === 'tailwind' ? PublisherSkinTailwind : PublisherSkin;

return (
<SandboxI18nProvider>
<Provider>
<Player>
<Skin className="mx-auto aspect-video w-full max-w-4xl">
{real ? <MoqPublishVideo publishEndpoint={relay} publishNamespace={namespace} /> : <FakePublishVideo />}
</Skin>
</Provider>
</Player>
</SandboxI18nProvider>
);
}
Expand Down
9 changes: 9 additions & 0 deletions packages/core/src/core/ui/camera-button/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineComponent } from 'vjsc/components';

import type { CameraButtonProps } from './core';
import { CameraButtonDataAttrs } from './data';

export default defineComponent<CameraButtonProps>({
name: 'CameraButton',
dataAttrs: CameraButtonDataAttrs,
});
14 changes: 14 additions & 0 deletions packages/core/src/core/ui/camera-radio-group/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineComponent } from 'vjsc/components';

import type { CameraRadioGroupProps } from './core';
import { CameraRadioGroupDataAttrs } from './data';

export default defineComponent({
name: 'CameraRadioGroup',
parts: {
Root: defineComponent<CameraRadioGroupProps>(),
Value: defineComponent(),
Options: defineComponent(),
},
dataAttrs: CameraRadioGroupDataAttrs,
});
9 changes: 9 additions & 0 deletions packages/core/src/core/ui/capture-placeholder/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineComponent } from 'vjsc/components';

import type { CapturePlaceholderProps } from './core';
import { CapturePlaceholderDataAttrs } from './data';

export default defineComponent<CapturePlaceholderProps>({
name: 'CapturePlaceholder',
dataAttrs: CapturePlaceholderDataAttrs,
});
9 changes: 9 additions & 0 deletions packages/core/src/core/ui/connection-indicator/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineComponent } from 'vjsc/components';

import type { ConnectionIndicatorProps } from './core';
import { ConnectionIndicatorDataAttrs } from './data';

export default defineComponent<ConnectionIndicatorProps>({
name: 'ConnectionIndicator',
dataAttrs: ConnectionIndicatorDataAttrs,
});
9 changes: 9 additions & 0 deletions packages/core/src/core/ui/enable-devices-button/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineComponent } from 'vjsc/components';

import type { EnableDevicesButtonProps } from './core';
import { EnableDevicesButtonDataAttrs } from './data';

export default defineComponent<EnableDevicesButtonProps>({
name: 'EnableDevicesButton',
dataAttrs: EnableDevicesButtonDataAttrs,
});
9 changes: 9 additions & 0 deletions packages/core/src/core/ui/mic-button/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineComponent } from 'vjsc/components';

import type { MicButtonProps } from './core';
import { MicButtonDataAttrs } from './data';

export default defineComponent<MicButtonProps>({
name: 'MicButton',
dataAttrs: MicButtonDataAttrs,
});
14 changes: 14 additions & 0 deletions packages/core/src/core/ui/mic-radio-group/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineComponent } from 'vjsc/components';

import type { MicRadioGroupProps } from './core';
import { MicRadioGroupDataAttrs } from './data';

export default defineComponent({
name: 'MicRadioGroup',
parts: {
Root: defineComponent<MicRadioGroupProps>(),
Value: defineComponent(),
Options: defineComponent(),
},
dataAttrs: MicRadioGroupDataAttrs,
});
9 changes: 9 additions & 0 deletions packages/core/src/core/ui/publish-badge/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineComponent } from 'vjsc/components';

import type { PublishBadgeProps } from './core';
import { PublishBadgeDataAttrs } from './data';

export default defineComponent<PublishBadgeProps>({
name: 'PublishBadge',
dataAttrs: PublishBadgeDataAttrs,
});
9 changes: 9 additions & 0 deletions packages/core/src/core/ui/publish-button/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineComponent } from 'vjsc/components';

import type { PublishButtonProps } from './core';
import { PublishButtonDataAttrs } from './data';

export default defineComponent<PublishButtonProps>({
name: 'PublishButton',
dataAttrs: PublishButtonDataAttrs,
});
9 changes: 9 additions & 0 deletions packages/core/src/core/ui/publish-timer/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineComponent } from 'vjsc/components';

import type { PublishTimerProps } from './core';
import { PublishTimerDataAttrs } from './data';

export default defineComponent<PublishTimerProps>({
name: 'PublishTimer',
dataAttrs: PublishTimerDataAttrs,
});
9 changes: 9 additions & 0 deletions packages/core/src/core/ui/screen-share-button/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineComponent } from 'vjsc/components';

import type { ScreenShareButtonProps } from './core';
import { ScreenShareButtonDataAttrs } from './data';

export default defineComponent<ScreenShareButtonProps>({
name: 'ScreenShareButton',
dataAttrs: ScreenShareButtonDataAttrs,
});
3 changes: 1 addition & 2 deletions packages/html/src/define/publisher/skin.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "../global.css";
@import "../shadow.css";
@import "../../presets/publisher/legacy-skin/host.css";
@import "../../presets/publisher/legacy-skin/default/css/publisher.css";
@import "../../internal/skins/default-publisher/skin.css";
5 changes: 0 additions & 5 deletions packages/html/src/define/publisher/skin.tailwind.ts

This file was deleted.

5 changes: 4 additions & 1 deletion packages/html/src/define/publisher/skin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { VideoPublisherElement } from '../../presets/publisher/player';
import { PublisherSkinElement } from '../../presets/publisher/skin';
import { safeDefine } from '../../registration/safe-define';
import './ui';
import '../../internal/skins/default-publisher/register';

// The skin entry has always registered its player too, so `<video-publisher>` works with this one import.
safeDefine(VideoPublisherElement);
safeDefine(PublisherSkinElement);
1 change: 0 additions & 1 deletion packages/html/src/presets/publisher/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
export { publisherFeatures } from '@videojs/core/dom';
export { PlayerController, VideoPublisherElement } from './player';
export { PublisherSkinElement } from './skin';
export { PublisherSkinTailwindElement } from './skin.tailwind';
5 changes: 0 additions & 5 deletions packages/html/src/presets/publisher/legacy-skin/README.md

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading