@livo-tv/blocks 1.32.1 → 1.33.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.
package/dist/index.d.cts CHANGED
@@ -2,7 +2,6 @@ import * as React from 'react';
2
2
  import { FormEvent, KeyboardEvent, RefObject, CSSProperties, ReactNode, ComponentProps, ImgHTMLAttributes, SyntheticEvent } from 'react';
3
3
  import * as class_variance_authority_types from 'class-variance-authority/types';
4
4
  import { VariantProps } from 'class-variance-authority';
5
- import { HlsConfig, RetryConfig, LoaderResponse } from 'hls.js';
6
5
  import { ClassValue } from 'clsx';
7
6
  export { AvatarColors, avatarFallbackStyle, getAvatarColors, getInitials } from './avatar.cjs';
8
7
 
@@ -466,578 +465,6 @@ interface AvatarEditorDialogProps {
466
465
  }
467
466
  declare function AvatarEditorDialog({ value, onChange, onSave, displaySize, editorSize, outputSize, placeholder, editLabel, dialogTitle, acceptText, cancelText, savingText, savedText, successMessage, errorMessage, className, editorLabels, }: AvatarEditorDialogProps): React.JSX.Element;
468
467
 
469
- declare const SHADER_CURTAIN_TYPES: readonly ["plane", "sphere", "waterPlane"];
470
- declare const SHADER_VARIANTS: readonly ["defaults", "cosmic", "glass", "positionMix"];
471
- declare const SHADER_LIGHT_TYPES: readonly ["3d", "env"];
472
- declare const SHADER_ENV_PRESETS: readonly ["city", "dawn", "lobby"];
473
- declare const SHADER_ON_OFF: readonly ["on", "off"];
474
- declare const SHADER_RANGE: readonly ["enabled", "disabled"];
475
- type ShaderCurtainConfig = {
476
- type: (typeof SHADER_CURTAIN_TYPES)[number];
477
- shader: (typeof SHADER_VARIANTS)[number];
478
- animate: (typeof SHADER_ON_OFF)[number];
479
- uTime: number;
480
- uSpeed: number;
481
- uStrength: number;
482
- uDensity: number;
483
- uFrequency: number;
484
- uAmplitude: number;
485
- wireframe: boolean;
486
- loop: (typeof SHADER_ON_OFF)[number];
487
- loopDuration: number;
488
- range: (typeof SHADER_RANGE)[number];
489
- rangeStart: number;
490
- rangeEnd: number;
491
- positionX: number;
492
- positionY: number;
493
- positionZ: number;
494
- rotationX: number;
495
- rotationY: number;
496
- rotationZ: number;
497
- color1: string;
498
- color2: string;
499
- color3: string;
500
- reflection: number;
501
- brightness: number;
502
- cAzimuthAngle: number;
503
- cPolarAngle: number;
504
- cDistance: number;
505
- cameraZoom: number;
506
- fov: number;
507
- zoomOut: boolean;
508
- lightType: (typeof SHADER_LIGHT_TYPES)[number];
509
- envPreset: (typeof SHADER_ENV_PRESETS)[number];
510
- grain: (typeof SHADER_ON_OFF)[number];
511
- grainBlending: number;
512
- pixelDensity: number;
513
- };
514
- declare const DEFAULT_SHADER_CURTAIN_CONFIG: ShaderCurtainConfig;
515
- type ShaderCurtainPreset = {
516
- id: string;
517
- title: string;
518
- config: ShaderCurtainConfig;
519
- };
520
- declare const SHADER_CURTAIN_PRESETS: readonly ShaderCurtainPreset[];
521
- declare function mergeShaderCurtainConfig(partial?: Partial<ShaderCurtainConfig> | null): ShaderCurtainConfig;
522
- declare function parseShaderGradientUrl(input: string): ShaderCurtainConfig | null;
523
- declare function toShaderGradientUrl(config: ShaderCurtainConfig): string;
524
- declare function isShaderCurtainKind(kind: string): kind is "shader";
525
-
526
- type CurtainKind = "image" | "video" | "shader";
527
- interface CurtainStageLabels {
528
- play?: string;
529
- tapToUnmute?: string;
530
- mute?: string;
531
- unmute?: string;
532
- }
533
- interface CurtainStageProps {
534
- kind: CurtainKind;
535
- url: string;
536
- alt?: string;
537
- className?: string;
538
- config?: ShaderCurtainConfig;
539
- envBasePath?: string;
540
- /** When true, video curtains show a static frame instead of looping. */
541
- reducedMotion?: boolean;
542
- /**
543
- * Waiting-room only. Starts muted, then offers tap-to-unmute when the
544
- * file has (or may have) an audio track. Picker tiles leave this off.
545
- */
546
- allowSound?: boolean;
547
- labels?: CurtainStageLabels;
548
- }
549
- /**
550
- * Waiting-room backdrop: a still image or a looping video that starts muted.
551
- * Honors `prefers-reduced-motion` (or an explicit `reducedMotion` prop)
552
- * by freezing video on the first frame. `allowSound` offers tap-to-unmute
553
- * when the file has audio.
554
- */
555
- declare function CurtainStage({ kind, url, alt, className, config, envBasePath, reducedMotion, allowSound, labels, }: CurtainStageProps): React.JSX.Element;
556
-
557
- type CurtainPreviewProps = {
558
- kind: CurtainKind | string;
559
- url: string | null;
560
- alt?: string;
561
- className?: string;
562
- /**
563
- * When true (default), video curtains loop only while the tile is on
564
- * screen. Off-screen and `prefers-reduced-motion` tiles stay on a
565
- * static first frame so a large grid does not play every loop at once.
566
- */
567
- playWhenVisible?: boolean;
568
- /** Force a static first frame even when the tile is visible. */
569
- frozen?: boolean;
570
- };
571
- /**
572
- * Thumbnail for a curtain asset: still image, or a muted looping video
573
- * that plays only while visible (unless reduced motion is on).
574
- */
575
- declare function CurtainPreview({ kind, url, alt, className, playWhenVisible, frozen, }: CurtainPreviewProps): React.JSX.Element;
576
-
577
- type CurtainPickerOwnerType = "organization" | "platform" | string;
578
- type CurtainPickerItem = {
579
- id: string;
580
- title: string;
581
- kind: CurtainKind | string;
582
- publicUrl: string | null;
583
- ownerType?: CurtainPickerOwnerType;
584
- /** Consumer-computed default (org setting or platform `isDefault`). */
585
- isDefault?: boolean;
586
- };
587
- type CurtainPickerLabels = {
588
- select?: string;
589
- none?: string;
590
- noneDescription?: string;
591
- defaultBadge?: string;
592
- makeDefault?: string;
593
- edit?: string;
594
- delete?: string;
595
- image?: string;
596
- video?: string;
597
- shader?: string;
598
- organization?: string;
599
- platform?: string;
600
- groupOrganization?: string;
601
- groupPlatform?: string;
602
- groupOther?: string;
603
- emptyTitle?: string;
604
- emptyDescription?: string;
605
- };
606
- declare const DEFAULT_CURTAIN_PICKER_LABELS: Required<CurtainPickerLabels>;
607
- type CurtainPickerProps = {
608
- curtains: CurtainPickerItem[];
609
- /** Selected curtain id. `null` / `""` means the optional None tile. */
610
- value?: string | null;
611
- onChange?: (id: string | null) => void;
612
- allowNone?: boolean;
613
- disabled?: boolean;
614
- /** `compact` is a selected preview plus a dense thumbnail grid. */
615
- variant?: "default" | "compact";
616
- /** Split the grid into organization / platform / other sections. */
617
- groupByOwner?: boolean;
618
- onMakeDefault?: (item: CurtainPickerItem) => void;
619
- onEdit?: (item: CurtainPickerItem) => void;
620
- onDelete?: (item: CurtainPickerItem) => void;
621
- canMakeDefault?: (item: CurtainPickerItem) => boolean;
622
- canDelete?: (item: CurtainPickerItem) => boolean;
623
- labels?: CurtainPickerLabels;
624
- emptyAction?: React.ReactNode;
625
- className?: string;
626
- /** Disable action buttons while a mutation is in flight. */
627
- actionsPending?: boolean;
628
- };
629
- declare function CurtainPickerSkeleton({ count, variant, className, }: {
630
- count?: number;
631
- variant?: "default" | "compact";
632
- className?: string;
633
- }): React.JSX.Element;
634
- /**
635
- * Presentational curtain catalog: visual image / looping-video tiles,
636
- * optional selection (including None), and optional manage actions.
637
- * Consumers fetch, upload, and confirm deletes themselves.
638
- */
639
- declare function CurtainPicker({ curtains, value, onChange, allowNone, disabled, variant, groupByOwner, onMakeDefault, onEdit, onDelete, canMakeDefault, canDelete, labels, emptyAction, className, actionsPending, }: CurtainPickerProps): React.JSX.Element;
640
-
641
- interface WaitingRoomCurtain {
642
- kind: CurtainKind;
643
- url: string;
644
- config?: ShaderCurtainConfig;
645
- envBasePath?: string;
646
- }
647
- interface WaitingRoomProps {
648
- title: string;
649
- organizationName?: string | null;
650
- organizationImage?: string | null;
651
- startsAt?: number | null;
652
- durationSeconds?: number | null;
653
- curtain?: WaitingRoomCurtain | null;
654
- hideBranding?: boolean;
655
- hideStatus?: boolean;
656
- nowMs?: number;
657
- labels?: {
658
- startsIn?: string;
659
- started?: string;
660
- duration?: (minutes: number) => string;
661
- };
662
- className?: string;
663
- }
664
- /**
665
- * Public waiting-room chrome: curtain (or calm branded fallback), title,
666
- * org avatar, and a countdown to `startsAt`.
667
- */
668
- declare function WaitingRoom({ title, organizationName, organizationImage, startsAt, durationSeconds, curtain, hideBranding, hideStatus, nowMs, labels, className, }: WaitingRoomProps): React.JSX.Element;
669
-
670
- type ShaderCurtainProps = {
671
- config: ShaderCurtainConfig | Partial<ShaderCurtainConfig>;
672
- posterUrl?: string | null;
673
- envBasePath?: string;
674
- className?: string;
675
- /** Editor only — needed for canvas.toBlob capture. */
676
- preserveDrawingBuffer?: boolean;
677
- reducedMotion?: boolean;
678
- alt?: string;
679
- };
680
- /**
681
- * Live ShaderGradient canvas with a poster fallback while the optional
682
- * WebGL peers load, when WebGL is missing, or when motion is reduced.
683
- */
684
- declare function ShaderCurtain({ config, posterUrl, envBasePath, className, preserveDrawingBuffer, reducedMotion, alt, }: ShaderCurtainProps): React.JSX.Element;
685
-
686
- type ShaderCurtainEditorLabels = {
687
- shape?: string;
688
- colors?: string;
689
- light?: string;
690
- camera?: string;
691
- presets?: string;
692
- importUrl?: string;
693
- importApply?: string;
694
- importError?: string;
695
- };
696
- declare const DEFAULT_SHADER_CURTAIN_EDITOR_LABELS: Required<ShaderCurtainEditorLabels>;
697
- type ShaderCurtainEditorHandle = {
698
- getConfig: () => ShaderCurtainConfig;
699
- capturePoster: () => Promise<Blob | null>;
700
- };
701
- type ShaderCurtainEditorProps = {
702
- value?: Partial<ShaderCurtainConfig>;
703
- onChange?: (config: ShaderCurtainConfig) => void;
704
- envBasePath?: string;
705
- className?: string;
706
- labels?: ShaderCurtainEditorLabels;
707
- };
708
- declare const ShaderCurtainEditor: React.ForwardRefExoticComponent<ShaderCurtainEditorProps & React.RefAttributes<ShaderCurtainEditorHandle>>;
709
-
710
- type CaptureShaderPosterOptions = {
711
- quality?: number;
712
- type?: "image/jpeg" | "image/png";
713
- };
714
- /**
715
- * Snapshot the live ShaderGradient canvas. The editor must pass
716
- * `preserveDrawingBuffer` or the pixels will be empty.
717
- */
718
- declare function captureShaderPoster(root: HTMLElement, options?: CaptureShaderPosterOptions): Promise<Blob | null>;
719
-
720
- type CastFramework = {
721
- CastContext: {
722
- getInstance: () => {
723
- setOptions: (options: {
724
- receiverApplicationId: string;
725
- autoJoinPolicy?: string;
726
- }) => void;
727
- requestSession: () => Promise<unknown>;
728
- getCurrentSession: () => {
729
- loadMedia: (request: unknown) => Promise<unknown>;
730
- } | null;
731
- };
732
- };
733
- };
734
- type ChromeCast = {
735
- media: {
736
- DEFAULT_MEDIA_RECEIVER_APP_ID: string;
737
- MediaInfo: new (url: string, contentType: string) => unknown;
738
- LoadRequest: new (media: unknown) => unknown;
739
- };
740
- AutoJoinPolicy?: {
741
- ORIGIN_SCOPED: string;
742
- };
743
- };
744
- declare global {
745
- interface Window {
746
- cast?: {
747
- framework?: CastFramework;
748
- };
749
- chrome?: {
750
- cast?: ChromeCast;
751
- };
752
- __onGCastApiAvailable?: (available: boolean) => void;
753
- }
754
- }
755
- declare function loadCastSender(): Promise<void>;
756
- /** Cast an HLS master playlist to the default Chromecast media receiver. */
757
- declare function castHlsUrl(hlsUrl: string): Promise<void>;
758
-
759
- /**
760
- * Playback error description, ported from the app's HLS player but stripped of
761
- * Sentry. `@livo/blocks` must stay reporting-agnostic: the player surfaces
762
- * a {@link DescribedPlaybackError} through an optional `onError` prop so each
763
- * app can wire its own reporting (Sentry, Datadog, console, …).
764
- *
765
- * User-facing messages are intentionally NOT baked in here — they come from the
766
- * player's `labels` prop so they stay translatable. This module only classifies
767
- * the error and produces a machine-readable summary + detail for logging.
768
- */
769
- type HlsPlayerMode = "live" | "vod";
770
- /** Coarse category the player uses to pick the right localized message. */
771
- type PlaybackErrorKind = "unavailable" | "network" | "media" | "unsupported" | "resync" | "generic";
772
- type PlaybackErrorContext = {
773
- mode: HlsPlayerMode;
774
- src: string;
775
- manifestParsed: boolean;
776
- retryCount?: number;
777
- source: "hls" | "native" | "unsupported";
778
- };
779
- type PlaybackErrorDetail = {
780
- source: PlaybackErrorContext["source"];
781
- kind: PlaybackErrorKind;
782
- type?: string;
783
- details?: string;
784
- fatal?: boolean;
785
- httpStatus?: number;
786
- url?: string;
787
- reason?: string;
788
- errorMessage?: string;
789
- mediaErrorCode?: number;
790
- mediaErrorName?: string;
791
- context: PlaybackErrorContext;
792
- };
793
- type DescribePlaybackErrorInput = {
794
- source: "hls";
795
- type?: string;
796
- details?: string;
797
- fatal: boolean;
798
- url?: string;
799
- response?: {
800
- code?: number;
801
- text?: string;
802
- };
803
- reason?: string;
804
- error?: unknown;
805
- context: PlaybackErrorContext;
806
- } | {
807
- source: "native";
808
- mediaError?: MediaError | null;
809
- context: PlaybackErrorContext;
810
- } | {
811
- source: "unsupported";
812
- context: PlaybackErrorContext;
813
- };
814
- type DescribedPlaybackError = {
815
- /** Machine-readable one-line summary for logs. */
816
- summary: string;
817
- /** Coarse category for choosing a localized message. */
818
- kind: PlaybackErrorKind;
819
- detail: PlaybackErrorDetail;
820
- };
821
- /**
822
- * Soft (non-fatal) report for an automatic A/V resync. Apps should treat this
823
- * like other non-fatal playback events (breadcrumb / warn), never as a hard
824
- * error UI — the player recovers in place.
825
- */
826
- declare function describeAvResync(input: {
827
- lagSeconds: number;
828
- context: PlaybackErrorContext;
829
- }): DescribedPlaybackError;
830
- declare function describePlaybackError(input: DescribePlaybackErrorInput): DescribedPlaybackError;
831
-
832
- interface PlaybackStats {
833
- /** Concurrent live viewers (meaningful in live mode). */
834
- viewers?: number;
835
- /** Cumulative VOD reproductions. */
836
- views?: number;
837
- }
838
- interface UsePlaybackStatsOptions {
839
- /** Poll interval in ms. Default 15000. */
840
- intervalMs?: number;
841
- /** When false, polling is paused. Default true. */
842
- enabled?: boolean;
843
- }
844
- /**
845
- * Polls a playback-stats endpoint (media-svc `GET /playback/:mediaId/stats`)
846
- * and returns `{ viewers, views }`. Plain `fetch`, zero dependencies, so wiring
847
- * it into an app is a one-liner. Fails silently (stats are non-critical); the
848
- * last successful value is retained across transient errors.
849
- */
850
- declare function usePlaybackStats(statsUrl: string | null | undefined, { intervalMs, enabled }?: UsePlaybackStatsOptions): PlaybackStats;
851
-
852
- declare const CAPTION_LOCALES: readonly ["en", "es", "pt"];
853
- type CaptionLocale = (typeof CAPTION_LOCALES)[number];
854
- declare function isCaptionLocale(value: string): value is CaptionLocale;
855
- declare function captionsVttUrlFromPlayback(src: string, locale: CaptionLocale): string | null;
856
-
857
- interface VideoPlayerLabels {
858
- play?: string;
859
- pause?: string;
860
- mute?: string;
861
- unmute?: string;
862
- enterFullscreen?: string;
863
- exitFullscreen?: string;
864
- pictureInPicture?: string;
865
- cast?: string;
866
- settings?: string;
867
- /** Overflow menu for speed / quality / cast / PiP on a narrow player. */
868
- more?: string;
869
- /** Back control on compact More speed / quality panes. */
870
- back?: string;
871
- quality?: string;
872
- auto?: string;
873
- speed?: string;
874
- live?: string;
875
- goLive?: string;
876
- tapToUnmute?: string;
877
- loading?: string;
878
- waiting?: string;
879
- retry?: string;
880
- /** Messages by error kind; a generic fallback covers the rest. */
881
- errorUnavailable?: string;
882
- errorNetwork?: string;
883
- errorMedia?: string;
884
- errorUnsupported?: string;
885
- errorGeneric?: string;
886
- /** `(n) => "N watching"`. */
887
- formatViewers?: (n: number) => string;
888
- /** `(n) => "N views"`. */
889
- formatViews?: (n: number) => string;
890
- captions?: string;
891
- captionsOff?: string;
892
- captionsEn?: string;
893
- captionsEs?: string;
894
- captionsPt?: string;
895
- /** @deprecated Unused after movie-style captions; kept for existing callers. */
896
- captionsLatest?: string;
897
- }
898
- interface VideoPlayerProps {
899
- src: string;
900
- mode: "live" | "vod";
901
- /** Cover image; renders a click-to-play state before attaching HLS. */
902
- poster?: string;
903
- autoPlay?: boolean;
904
- muted?: boolean;
905
- /** Presentational stats (see `usePlaybackStats`). */
906
- stats?: PlaybackStats;
907
- labels?: VideoPlayerLabels;
908
- /** Show the resolution picker when multiple levels exist. Default true. */
909
- showQualitySelector?: boolean;
910
- /**
911
- * When true, force-pauses the media element. Clearing it does not
912
- * auto-resume — the user must press play again.
913
- */
914
- paused?: boolean;
915
- onPlayingChange?: (playing: boolean) => void;
916
- /** Fires once, the first time playback actually starts — wire your view
917
- * beacon here. */
918
- onFirstPlay?: () => void;
919
- onError?: (error: DescribedPlaybackError) => void;
920
- /** Throttled ~5s while the playhead advances. */
921
- onPlaybackProgress?: (currentTime: number, duration: number) => void;
922
- onRebuffer?: (seconds: number) => void;
923
- onQualityChange?: (quality: string) => void;
924
- /**
925
- * Default `aspect-video` for feed cards. Use `contain` in fullscreen
926
- * viewers so portrait sources fill the pane with object-fit and controls
927
- * stay at the bottom of the pane.
928
- */
929
- fit?: "aspect-video" | "contain";
930
- className?: string;
931
- /** Optional initial CC language. Defaults to Off. UI locale / `?lang=` do not enable captions. */
932
- defaultCaptionLocale?: CaptionLocale;
933
- /**
934
- * When false, hide the CC menu and do not attach sidecar or live caption
935
- * tracks. Defaults to true so existing callers keep current behavior.
936
- */
937
- captionsEnabled?: boolean;
938
- /** Live poll base, e.g. `https://api.livo.tv/public/streams/{id}/captions`. */
939
- liveCaptionsBaseUrl?: string | null;
940
- }
941
- /**
942
- * Standardized HLS video player with a fully custom control bar (no native
943
- * `controls`): click-to-play poster, play/pause, mute + volume, resolution
944
- * picker, playback speed (VOD), Picture-in-Picture, fullscreen, a VOD seekbar
945
- * with buffered ranges, and a live badge (no seekbar) with a "go live"
946
- * affordance. `stats` renders live viewer / VOD reproduction counts.
947
- *
948
- * hls.js is a peer dependency loaded on demand; see {@link useHlsPlayback}.
949
- */
950
- declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, paused, onPlayingChange, onFirstPlay, onError, onPlaybackProgress, onRebuffer, onQualityChange, fit, className, defaultCaptionLocale, captionsEnabled, liveCaptionsBaseUrl, }: VideoPlayerProps): React.JSX.Element;
951
-
952
- interface FeedVideoPlayerProps extends VideoPlayerProps {
953
- /** Stable id for exclusive playback (typically the feed post id). */
954
- playbackId: string;
955
- }
956
- /**
957
- * Feed-scoped {@link VideoPlayer}: only one feed video plays at a time, and
958
- * playback autopauses when the card leaves the viewport or the tab is hidden.
959
- */
960
- declare function FeedVideoPlayer({ playbackId, onPlayingChange, paused: pausedProp, fit, className, ...playerProps }: FeedVideoPlayerProps): React.JSX.Element;
961
-
962
- interface UseFeedExclusivePlaybackResult {
963
- containerRef: React.RefObject<HTMLDivElement | null>;
964
- paused: boolean;
965
- onPlayingChange: (playing: boolean) => void;
966
- }
967
- /**
968
- * Coordinates exclusive feed playback: claims the global slot on play,
969
- * force-pauses when another feed video plays, when the player leaves the
970
- * viewport, or when the tab is hidden. Picture-in-Picture is exempt from
971
- * scroll/visibility autopause.
972
- */
973
- declare function useFeedExclusivePlayback(playbackId: string): UseFeedExclusivePlaybackResult;
974
-
975
- type PlaybackState = "idle" | "loading" | "ready" | "waiting" | "error";
976
- /** Autoplay overlay state once the manifest is parsed. */
977
- type AutoplayState = "none" | "playing" | "muted" | "blocked";
978
- interface QualityLevel {
979
- /** hls.js level index. */
980
- index: number;
981
- /** Vertical resolution, e.g. 720. */
982
- height: number;
983
- }
984
- interface UseHlsPlaybackOptions {
985
- src: string;
986
- mode: HlsPlayerMode;
987
- /** When false, nothing is attached/loaded (poster gating). */
988
- active: boolean;
989
- /** Attempt autoplay once the manifest is ready. Live always autoplays. */
990
- autoPlay?: boolean;
991
- /** Start muted (independent of the autoplay cascade). */
992
- muted?: boolean;
993
- onError?: (error: DescribedPlaybackError) => void;
994
- onPlayingChange?: (playing: boolean) => void;
995
- onRebuffer?: (seconds: number) => void;
996
- onQualityChange?: (quality: string) => void;
997
- }
998
- interface UseHlsPlaybackResult {
999
- videoRef: React.RefObject<HTMLVideoElement | null>;
1000
- state: PlaybackState;
1001
- /** Available quality levels (empty for native HLS / single-level). */
1002
- qualities: QualityLevel[];
1003
- /** Selected level index, or -1 for automatic. */
1004
- activeLevel: number;
1005
- setLevel: (index: number) => void;
1006
- autoplayState: AutoplayState;
1007
- /** The classified error, when `state === "error"`. */
1008
- error: DescribedPlaybackError | null;
1009
- retry: () => void;
1010
- /**
1011
- * Chrome mode derived from the playlist. A `/live/` src stays `"live"`
1012
- * until hls.js reports `#EXT-X-ENDLIST` (`details.live === false`).
1013
- * Non-live srcs follow the `mode` prop.
1014
- */
1015
- effectiveMode: HlsPlayerMode;
1016
- }
1017
- /**
1018
- * Attaches hls.js (loaded on demand via dynamic import) or native HLS to a
1019
- * `<video>` element and exposes the state a custom control bar needs. Ported
1020
- * from the app's production `HlsPlayer` effect, minus the built-in UI and
1021
- * Sentry: errors are classified and handed to `onError`.
1022
- */
1023
- declare function useHlsPlayback({ src, mode, active, autoPlay, muted, onError, onPlayingChange, onRebuffer, onQualityChange, }: UseHlsPlaybackOptions): UseHlsPlaybackResult;
1024
-
1025
- /** Retry transient live-edge 404s; hls.js skips all 4xx by default. */
1026
- declare function shouldRetryLiveEdge404(retryConfig: RetryConfig | null | undefined, retryCount: number, _isTimeout: boolean, loaderResponse: LoaderResponse | undefined, defaultRetry: boolean): boolean;
1027
- /**
1028
- * HLS.js options tuned for live playback through a Cloudflare R2 custom domain.
1029
- * Ported from the app's production player: stays 4 segments (~8s) behind the
1030
- * live edge so transient upload lag never reaches the playhead, and retries the
1031
- * 404s that appear while a new segment is still being written.
1032
- */
1033
- declare function createLiveHlsConfig(): Partial<HlsConfig>;
1034
- /**
1035
- * HLS.js options for on-demand (VOD) playback. No live-edge cushion; enables
1036
- * the worker and lets hls.js manage the buffer with its defaults, which are
1037
- * well suited to seekable recordings.
1038
- */
1039
- declare function createVodHlsConfig(): Partial<HlsConfig>;
1040
-
1041
468
  type MultipartUploadPart = {
1042
469
  partNumber: number;
1043
470
  etag: string;
@@ -1158,41 +585,6 @@ declare function useMediaQuery(query: string): boolean;
1158
585
 
1159
586
  declare function cn(...inputs: ClassValue[]): string;
1160
587
 
1161
- type PlaybackBeaconEventType = "view" | "progress" | "rebuffer" | "quality_change" | "error";
1162
- type PlaybackBeaconSurface = "app" | "player" | "embed" | "sdk";
1163
- type PlaybackBeaconEvent = {
1164
- type: PlaybackBeaconEventType;
1165
- ts: number;
1166
- streamId?: string;
1167
- vodId?: string;
1168
- currentTime?: number;
1169
- duration?: number;
1170
- rebufferSeconds?: number;
1171
- quality?: string;
1172
- errorCode?: string;
1173
- surface?: PlaybackBeaconSurface | string;
1174
- [key: string]: unknown;
1175
- };
1176
- type PlaybackBeaconTrackInput = Omit<PlaybackBeaconEvent, "ts"> & {
1177
- ts?: number;
1178
- };
1179
- type CreatePlaybackBeaconClientOptions = {
1180
- endpoint: string;
1181
- sessionId: string;
1182
- surface: PlaybackBeaconSurface | string;
1183
- getContext?: () => Record<string, unknown>;
1184
- /** Override for tests. */
1185
- fetchFn?: typeof fetch;
1186
- intervalMs?: number;
1187
- now?: () => number;
1188
- };
1189
- type PlaybackBeaconClient = {
1190
- track: (event: PlaybackBeaconTrackInput) => void;
1191
- flush: () => Promise<void>;
1192
- destroy: () => void;
1193
- };
1194
- declare function createPlaybackBeaconClient({ endpoint, sessionId, surface, getContext, fetchFn, intervalMs, now, }: CreatePlaybackBeaconClientOptions): PlaybackBeaconClient;
1195
-
1196
588
  type StatHighlightCardProps = {
1197
589
  label: string;
1198
590
  value: React.ReactNode;
@@ -1274,4 +666,4 @@ type MetricSkeletonProps = {
1274
666
  };
1275
667
  declare function MetricSkeleton({ className, bars }: MetricSkeletonProps): React.JSX.Element;
1276
668
 
1277
- export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorLabels, type AvatarEditorProps, type BlocksLanguage, CAPTION_LOCALES, type CaptionLocale, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, CostBreakdownCard, type CostBreakdownCardProps, type CostBreakdownItem, type CreateMultipartUploadControllerOptions, type CreatePlaybackBeaconClientOptions, type CurtainKind, CurtainPicker, type CurtainPickerItem, type CurtainPickerLabels, type CurtainPickerOwnerType, type CurtainPickerProps, CurtainPickerSkeleton, CurtainPreview, type CurtainPreviewProps, CurtainStage, type CurtainStageLabels, type CurtainStageProps, DEFAULT_CURTAIN_PICKER_LABELS, DEFAULT_EDITABLE_SECTION_LABELS, DEFAULT_FILE_DROPZONE_LABELS, DEFAULT_FILE_UPLOAD_LABELS, DEFAULT_FILE_UPLOAD_TRAY_LABELS, DEFAULT_NOTIFICATION_BELL_LABELS, DEFAULT_SHADER_CURTAIN_CONFIG, DEFAULT_SHADER_CURTAIN_EDITOR_LABELS, DataList, DataListItem, type DataListItemProps, type DataListProps, type DescribedPlaybackError, type DimensionBreakdownRow, DimensionBreakdownTable, type DimensionBreakdownTableProps, EditableSection, type EditableSectionLabels, type EditableSectionMode, type EditableSectionProps, type EditableSectionSlots, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, FeedVideoPlayer, type FeedVideoPlayerProps, FieldMessage, type FieldMessageProps, FileDropzone, type FileDropzoneLabels, type FileDropzoneProps, FileUploadMenu, type FileUploadMenuProps, FileUploadTray, type FileUploadTrayLabels, type FileUploadTrayProps, type HlsPlayerMode, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MetricChartCard, type MetricChartCardProps, MetricEmptyState, type MetricEmptyStateProps, MetricSkeleton, type MetricSkeletonProps, type MultipartUploadAdapter, type MultipartUploadController, type MultipartUploadPart, NotificationBell, type NotificationBellItem, type NotificationBellLabels, type NotificationBellProps, type PartRange, type PlaybackBeaconClient, type PlaybackBeaconEvent, type PlaybackBeaconEventType, type PlaybackBeaconSurface, type PlaybackBeaconTrackInput, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type QualityLevel, SHADER_CURTAIN_PRESETS, SafeImage, type SafeImageProps, ShaderCurtain, type ShaderCurtainConfig, ShaderCurtainEditor, type ShaderCurtainEditorHandle, type ShaderCurtainEditorLabels, type ShaderCurtainEditorProps, type ShaderCurtainPreset, type ShaderCurtainProps, SparklineStat, type SparklineStatProps, StatHighlightCard, type StatHighlightCardProps, TIME_RANGE_OPTIONS, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type TimeRange, TimeRangePicker, type TimeRangePickerLabels, type TimeRangePickerProps, type UploadControllerStatus, type UploadJob, type UploadJobStatus, type UploadProgress, type UseEditableSectionOptions, type UseEditableSectionResult, type UseFeedExclusivePlaybackResult, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, WaitingRoom, type WaitingRoomCurtain, type WaitingRoomProps, captionsVttUrlFromPlayback, captureShaderPoster, castHlsUrl, cn, createLiveHlsConfig, createMultipartUploadController, createPlaybackBeaconClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fileMatchesAccept, isCaptionLocale, isShaderCurtainKind, loadCastSender, mergeShaderCurtainConfig, parseShaderGradientUrl, partRanges, progressFromBytes, shouldRetryLiveEdge404, toShaderGradientUrl, useEditableSection, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats };
669
+ export { AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorLabels, type AvatarEditorProps, type BlocksLanguage, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, CostBreakdownCard, type CostBreakdownCardProps, type CostBreakdownItem, type CreateMultipartUploadControllerOptions, DEFAULT_EDITABLE_SECTION_LABELS, DEFAULT_FILE_DROPZONE_LABELS, DEFAULT_FILE_UPLOAD_LABELS, DEFAULT_FILE_UPLOAD_TRAY_LABELS, DEFAULT_NOTIFICATION_BELL_LABELS, DataList, DataListItem, type DataListItemProps, type DataListProps, type DimensionBreakdownRow, DimensionBreakdownTable, type DimensionBreakdownTableProps, EditableSection, type EditableSectionLabels, type EditableSectionMode, type EditableSectionProps, type EditableSectionSlots, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, FieldMessage, type FieldMessageProps, FileDropzone, type FileDropzoneLabels, type FileDropzoneProps, FileUploadMenu, type FileUploadMenuProps, FileUploadTray, type FileUploadTrayLabels, type FileUploadTrayProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MetricChartCard, type MetricChartCardProps, MetricEmptyState, type MetricEmptyStateProps, MetricSkeleton, type MetricSkeletonProps, type MultipartUploadAdapter, type MultipartUploadController, type MultipartUploadPart, NotificationBell, type NotificationBellItem, type NotificationBellLabels, type NotificationBellProps, type PartRange, SafeImage, type SafeImageProps, SparklineStat, type SparklineStatProps, StatHighlightCard, type StatHighlightCardProps, TIME_RANGE_OPTIONS, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type TimeRange, TimeRangePicker, type TimeRangePickerLabels, type TimeRangePickerProps, type UploadControllerStatus, type UploadJob, type UploadJobStatus, type UploadProgress, type UseEditableSectionOptions, type UseEditableSectionResult, cn, createMultipartUploadController, defaultLanguages, fileMatchesAccept, partRanges, progressFromBytes, useEditableSection, useLanguageContext, useMediaQuery };