@clipmux/player 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,62 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ type Chapter = {
5
+ startTime: number;
6
+ endTime: number;
7
+ title: string;
8
+ };
9
+ interface ClipMuxPlayerProps {
10
+ /**
11
+ * The ClipMux video ID. Used to resolve the HLS URL and track analytics.
12
+ * At minimum, one of `playbackId` or `src` must be provided.
13
+ */
14
+ playbackId?: string;
15
+ /**
16
+ * Direct HLS/DASH URL. Escape hatch for custom CDNs, proxies, or local files.
17
+ * If both `playbackId` and `src` are provided, `src` takes precedence for playback
18
+ * but `playbackId` is still sent to analytics.
19
+ */
20
+ src?: string;
21
+ /** Environment/public key identifying the tenant. */
22
+ envKey?: string;
23
+ /** Signed playback token for private content. Appended to the URL as `?token=`. */
24
+ token?: string;
25
+ /** Video title shown in the player chrome. */
26
+ title?: string;
27
+ /** Poster/thumbnail image URL. */
28
+ poster?: string;
29
+ /** Subtitle/caption VTT URL. */
30
+ subtitles?: string;
31
+ /** Chapter markers — converted to VTT internally. */
32
+ chapters?: Chapter[] | null;
33
+ /** Auto-play on load. */
34
+ autoPlay?: boolean;
35
+ /** Start muted. */
36
+ muted?: boolean;
37
+ /** Theme customization. */
38
+ theme?: {
39
+ /** Maps to `--video-brand` CSS variable. */
40
+ primaryColor?: string;
41
+ accentColor?: string;
42
+ };
43
+ /** Additional CSS class on the player container. */
44
+ className?: string;
45
+ /** Inline styles on the player container. */
46
+ style?: React.CSSProperties;
47
+ /**
48
+ * Override the analytics ingestion URL.
49
+ * Default: the ClipMux production beacon endpoint.
50
+ * Set to `false` to disable analytics entirely.
51
+ */
52
+ analyticsEndpoint?: string | false;
53
+ /** Fired when the player is ready. */
54
+ onReady?: () => void;
55
+ /** Fired on playback error. */
56
+ onError?: (err: Error) => void;
57
+ /** Fired when the video ends. */
58
+ onEnded?: () => void;
59
+ }
60
+ declare function ClipMuxPlayer({ playbackId, src, envKey, token, title, poster, subtitles, chapters, autoPlay, muted, theme, className, style, analyticsEndpoint, onReady, onError, onEnded: onEndedCallback, }: ClipMuxPlayerProps): react_jsx_runtime.JSX.Element;
61
+
62
+ export { type Chapter, ClipMuxPlayer, type ClipMuxPlayerProps };
@@ -0,0 +1,62 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ type Chapter = {
5
+ startTime: number;
6
+ endTime: number;
7
+ title: string;
8
+ };
9
+ interface ClipMuxPlayerProps {
10
+ /**
11
+ * The ClipMux video ID. Used to resolve the HLS URL and track analytics.
12
+ * At minimum, one of `playbackId` or `src` must be provided.
13
+ */
14
+ playbackId?: string;
15
+ /**
16
+ * Direct HLS/DASH URL. Escape hatch for custom CDNs, proxies, or local files.
17
+ * If both `playbackId` and `src` are provided, `src` takes precedence for playback
18
+ * but `playbackId` is still sent to analytics.
19
+ */
20
+ src?: string;
21
+ /** Environment/public key identifying the tenant. */
22
+ envKey?: string;
23
+ /** Signed playback token for private content. Appended to the URL as `?token=`. */
24
+ token?: string;
25
+ /** Video title shown in the player chrome. */
26
+ title?: string;
27
+ /** Poster/thumbnail image URL. */
28
+ poster?: string;
29
+ /** Subtitle/caption VTT URL. */
30
+ subtitles?: string;
31
+ /** Chapter markers — converted to VTT internally. */
32
+ chapters?: Chapter[] | null;
33
+ /** Auto-play on load. */
34
+ autoPlay?: boolean;
35
+ /** Start muted. */
36
+ muted?: boolean;
37
+ /** Theme customization. */
38
+ theme?: {
39
+ /** Maps to `--video-brand` CSS variable. */
40
+ primaryColor?: string;
41
+ accentColor?: string;
42
+ };
43
+ /** Additional CSS class on the player container. */
44
+ className?: string;
45
+ /** Inline styles on the player container. */
46
+ style?: React.CSSProperties;
47
+ /**
48
+ * Override the analytics ingestion URL.
49
+ * Default: the ClipMux production beacon endpoint.
50
+ * Set to `false` to disable analytics entirely.
51
+ */
52
+ analyticsEndpoint?: string | false;
53
+ /** Fired when the player is ready. */
54
+ onReady?: () => void;
55
+ /** Fired on playback error. */
56
+ onError?: (err: Error) => void;
57
+ /** Fired when the video ends. */
58
+ onEnded?: () => void;
59
+ }
60
+ declare function ClipMuxPlayer({ playbackId, src, envKey, token, title, poster, subtitles, chapters, autoPlay, muted, theme, className, style, analyticsEndpoint, onReady, onError, onEnded: onEndedCallback, }: ClipMuxPlayerProps): react_jsx_runtime.JSX.Element;
61
+
62
+ export { type Chapter, ClipMuxPlayer, type ClipMuxPlayerProps };