@hyperstream/videoplayer 0.1.4 → 0.1.6

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.js CHANGED
@@ -17158,7 +17158,7 @@ var init_video_transcript = __esm({
17158
17158
  // src/index.ts
17159
17159
  var index_exports = {};
17160
17160
  __export(index_exports, {
17161
- HyperstreamVideoPlayer: () => SimpleVideoPlayer
17161
+ HyperstreamVideoPlayer: () => SimpleVideoPlayerWithContext
17162
17162
  });
17163
17163
  module.exports = __toCommonJS(index_exports);
17164
17164
 
@@ -23172,18 +23172,27 @@ var PopupOverlay3 = import_react53.default.lazy(() => Promise.resolve().then(()
23172
23172
  var VideoOverlays2 = import_react53.default.lazy(() => Promise.resolve().then(() => (init_VideoOverlays(), VideoOverlays_exports)).then((mod) => ({ default: mod.VideoOverlays })));
23173
23173
  var VideoTranscript2 = import_react53.default.lazy(() => Promise.resolve().then(() => (init_video_transcript(), video_transcript_exports)).then((mod) => ({ default: mod.VideoTranscript })));
23174
23174
  function SimpleVideoPlayer({
23175
- poster,
23175
+ poster: initialPoster,
23176
23176
  watermark,
23177
- hyperstreamUrl,
23177
+ hyperstreamUrl: initialHyperstreamUrl,
23178
23178
  autoplay = false,
23179
23179
  muted = false,
23180
23180
  controls = true,
23181
23181
  objectFit = "contain",
23182
23182
  containerWidth,
23183
23183
  isMobile,
23184
- brandColor = "#d0d684",
23185
- playlist
23184
+ brandColor: initialBrandColor,
23185
+ playlist,
23186
+ // Aliases
23187
+ url: urlProp,
23188
+ primaryColor,
23189
+ thumbnail,
23190
+ title,
23191
+ artist
23186
23192
  }) {
23193
+ const hyperstreamUrl = urlProp || initialHyperstreamUrl;
23194
+ const brandColor = primaryColor || initialBrandColor || "#d0d684";
23195
+ const poster = thumbnail || initialPoster;
23187
23196
  const [apiPlaylist, setApiPlaylist] = (0, import_react53.useState)(null);
23188
23197
  const effectivePlaylist = (0, import_react53.useMemo)(() => {
23189
23198
  return apiPlaylist || playlist || { items: [] };
@@ -26394,330 +26403,341 @@ function SimpleVideoPlayer({
26394
26403
  document.removeEventListener("mousedown", handleClickOutside);
26395
26404
  };
26396
26405
  }, [showSettingsMenu]);
26397
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "w-full h-full", "data-hyperstream-player": "true", children: [
26398
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "relative h-full", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
26399
- "div",
26400
- {
26401
- ref: containerRef,
26402
- className: `
26406
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
26407
+ "div",
26408
+ {
26409
+ className: "w-full h-full text-left text-base font-sans leading-normal antialiased",
26410
+ "data-hyperstream-player": "true",
26411
+ style: { color: "white" },
26412
+ children: [
26413
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "relative h-full", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
26414
+ "div",
26415
+ {
26416
+ ref: containerRef,
26417
+ className: `
26403
26418
  relative w-full h-full bg-black rounded-lg overflow-hidden shadow-lg
26404
26419
  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#d0d684]/70 focus-visible:ring-offset-1
26405
26420
  `,
26406
- onMouseEnter: handleContainerMouseEnter,
26407
- onMouseLeave: handleContainerMouseLeave,
26408
- onMouseMove: handleContainerMouseMove,
26409
- onClick: handleContainerClick,
26410
- tabIndex: 0,
26411
- role: "application",
26412
- "aria-label": "Video player",
26413
- children: [
26414
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ErrorBoundary, { componentName: "PopupOverlay", brandColor, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react53.default.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26415
- PopupOverlay3,
26416
- {
26417
- activePopup,
26418
- activePopupStyles,
26419
- videoPopupsData,
26420
- formData,
26421
- formErrors,
26422
- activeResponses: interactiveResponses,
26423
- currentStep,
26424
- currentQuestionIndex: popupCurrentQuestionIndex,
26425
- quizCompleted: popupIsQuizCompleted,
26426
- showResults,
26427
- handlePopupAction,
26428
- handlePopupClose,
26429
- handleFormFieldChange,
26430
- handleFormSubmit,
26431
- handleMultiStepSubmit,
26432
- handleNextStep,
26433
- handlePrevStep,
26434
- handleInteractiveResponse,
26435
- handleQuizCompletion: popupQuizCompletion,
26436
- handleNextQuestion: popupNextQuestion,
26437
- handlePrevQuestion: popupPrevQuestion,
26438
- logEvent,
26439
- videoRef,
26440
- defaultUrl: hyperstreamUrl || "",
26441
- url: url || ""
26442
- }
26443
- ) }) }),
26444
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26445
- "video",
26446
- {
26447
- ref: videoRef,
26448
- className: `
26421
+ onMouseEnter: handleContainerMouseEnter,
26422
+ onMouseLeave: handleContainerMouseLeave,
26423
+ onMouseMove: handleContainerMouseMove,
26424
+ onClick: handleContainerClick,
26425
+ tabIndex: 0,
26426
+ role: "application",
26427
+ "aria-label": "Video player",
26428
+ children: [
26429
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ErrorBoundary, { componentName: "PopupOverlay", brandColor, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react53.default.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26430
+ PopupOverlay3,
26431
+ {
26432
+ activePopup,
26433
+ activePopupStyles,
26434
+ videoPopupsData,
26435
+ formData,
26436
+ formErrors,
26437
+ activeResponses: interactiveResponses,
26438
+ currentStep,
26439
+ currentQuestionIndex: popupCurrentQuestionIndex,
26440
+ quizCompleted: popupIsQuizCompleted,
26441
+ showResults,
26442
+ handlePopupAction,
26443
+ handlePopupClose,
26444
+ handleFormFieldChange,
26445
+ handleFormSubmit,
26446
+ handleMultiStepSubmit,
26447
+ handleNextStep,
26448
+ handlePrevStep,
26449
+ handleInteractiveResponse,
26450
+ handleQuizCompletion: popupQuizCompletion,
26451
+ handleNextQuestion: popupNextQuestion,
26452
+ handlePrevQuestion: popupPrevQuestion,
26453
+ logEvent,
26454
+ videoRef,
26455
+ defaultUrl: hyperstreamUrl || "",
26456
+ url: url || ""
26457
+ }
26458
+ ) }) }),
26459
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26460
+ "video",
26461
+ {
26462
+ ref: videoRef,
26463
+ className: `
26449
26464
  w-full h-full
26450
26465
  ${videoAspectRatio ? "absolute inset-0" : ""}
26451
26466
  `,
26452
- style: {
26453
- objectFit,
26454
- filter: mobileOptimization.isMobile ? `brightness(${brightnessLevel})` : void 0
26455
- },
26456
- playsInline: true,
26457
- "webkit-playsinline": "true",
26458
- crossOrigin: "anonymous",
26459
- autoPlay: autoplay,
26460
- muted: autoplay ? true : muted,
26461
- preload: autoplay ? "auto" : batteryOptimization.lowPowerMode ? "none" : connectionOptimization.saveData ? "metadata" : "auto",
26462
- onPlay: videoEventHandlers.onPlay,
26463
- onPause: videoEventHandlers.onPause,
26464
- onEnded: videoEventHandlers.onEnded,
26465
- onTimeUpdate: videoEventHandlers.onTimeUpdate,
26466
- onVolumeChange: videoEventHandlers.onVolumeChange,
26467
- onRateChange: videoEventHandlers.onRateChange,
26468
- onLoadStart: videoEventHandlers.onLoadStart,
26469
- onLoadedMetadata: videoEventHandlers.onLoadedMetadata,
26470
- onCanPlay: videoEventHandlers.onCanPlay,
26471
- onWaiting: videoEventHandlers.onWaiting,
26472
- onError: videoEventHandlers.onError,
26473
- onSeeking: videoEventHandlers.onSeeking,
26474
- onSeeked: videoEventHandlers.onSeeked
26475
- }
26476
- ),
26477
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AnimatePresence, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26478
- PosterOverlay,
26479
- {
26480
- isVisible: !!poster && showPoster,
26481
- posterUrl: poster,
26482
- onPlay: togglePlay,
26483
- onPosterLoad: () => {
26484
- debugLog("\u2705 Poster loaded successfully");
26485
- contentDispatch(contentActions.setLoaded(true));
26486
- },
26487
- onPosterError: () => {
26488
- console.error("\u274C Failed to load poster image:", poster);
26489
- contentDispatch(contentActions.error());
26490
- },
26491
- brandColor
26492
- }
26493
- ) }),
26494
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AnimatePresence, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26495
- LoadingSpinner,
26496
- {
26497
- isVisible: isBuffering,
26498
- brandColor,
26499
- size: "md"
26500
- }
26501
- ) }),
26502
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26503
- PasswordDialog,
26504
- {
26505
- isOpen: showPasswordDialog,
26506
- password: passwordInput,
26507
- onPasswordChange: (value) => authDispatch(authActions.setPasswordInput(value)),
26508
- onSubmit: handlePasswordSubmit,
26509
- onCancel: handlePasswordCancel,
26510
- isLoading: isAuthenticating,
26511
- error: passwordError,
26512
- brandColor
26513
- }
26514
- ),
26515
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AnimatePresence, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26516
- ErrorDisplay,
26517
- {
26518
- isVisible: hasError,
26519
- error,
26520
- onRetry: retry,
26521
- brandColor
26522
- }
26523
- ) }),
26524
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react53.default.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26525
- VideoOverlays2,
26526
- {
26527
- showSkipIndicator,
26528
- isPictureInPicture,
26529
- isSeeking,
26530
- seekingTime,
26531
- duration,
26532
- isPlaying,
26533
- isBuffering,
26534
- hasError,
26535
- showSeekbarTutorial,
26536
- showPoster,
26537
- showControls,
26538
- currentUrl,
26539
- videoTitle: (currentPlaylistItem == null ? void 0 : currentPlaylistItem.title) || videoTitle,
26540
- playbackRate,
26541
- showGestureIndicator,
26542
- gestureType,
26543
- volume,
26544
- brightnessLevel,
26545
- watermark: effectiveWatermark,
26546
- brandColor,
26547
- onTogglePlay: togglePlay
26548
- }
26549
- ) }),
26550
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ErrorBoundary, { componentName: "CaptionOverlay", minimal: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26551
- CaptionOverlay,
26552
- {
26553
- captionsEnabled,
26554
- currentCaption,
26555
- containerWidth: containerDimensions.width,
26556
- showControls
26557
- }
26558
- ) }),
26559
- showUpNext && hasNextTrack && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26560
- UpNextOverlay,
26561
- {
26562
- nextVideoTitle: (() => {
26563
- var _a;
26564
- const idx = peekNextIndex();
26565
- return idx !== null ? ((_a = effectivePlaylist.items[idx]) == null ? void 0 : _a.title) || "Next Video" : "Next Video";
26566
- })(),
26567
- countdownSeconds: upNextCountdown,
26568
- isPaused: !isPlaying,
26569
- brandColor,
26570
- onPlayNext: () => {
26571
- setShowUpNext(false);
26572
- handleNextTrack();
26573
- },
26574
- onCancel: () => {
26575
- setUpNextCancelled(true);
26576
- setShowUpNext(false);
26577
- toast2({
26578
- title: "Auto-play cancelled",
26579
- description: "Video will stop at the end.",
26580
- duration: 2e3
26581
- });
26582
- }
26583
- }
26584
- ),
26585
- !showSeekbarTutorial && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26586
- ControlBar,
26587
- {
26588
- isPlaying,
26589
- currentTime,
26590
- duration,
26591
- buffered,
26592
- isBuffering,
26593
- playbackRate,
26594
- volume,
26595
- isMuted,
26596
- isFullscreen,
26597
- isPictureInPicture,
26598
- pipSupported,
26599
- pipButtonDisabled: pipButtonState.disabled,
26600
- pipButtonReason: pipButtonState.reason,
26601
- showControls,
26602
- containerWidth: containerDimensions.width,
26603
- brandColor,
26604
- showChaptersButton: chaptersData.length > 0,
26605
- showCaptionsButton: effectiveCaptions.length > 0,
26606
- showSettingsButton: true,
26607
- showPipButton: containerDimensions.width >= 640,
26608
- showDockButton: chaptersData.length > 0 || transcriptData.length > 0,
26609
- showPlaylistButton: effectivePlaylist.items.length > 0,
26610
- onTogglePlaylist: handleTogglePlaylist,
26611
- onNextTrack: handleNextTrack,
26612
- onPrevTrack: handlePrevTrack,
26613
- hasNextTrack,
26614
- hasPrevTrack,
26615
- isPlaylistMode,
26616
- hasChapters: chaptersData.length > 0,
26617
- hasCaptions: effectiveCaptions.length > 0,
26618
- captionsEnabled,
26619
- showDock,
26620
- chapters: chaptersData,
26621
- currentChapter: currentChapter != null ? currentChapter : void 0,
26622
- onTogglePlay: togglePlay,
26623
- onSkip: skip,
26624
- onSeek: seek,
26625
- onVolumeChange: changeVolume,
26626
- onToggleMute: toggleMute,
26627
- onToggleFullscreen: toggleFullscreen,
26628
- onTogglePip: togglePictureInPicture,
26629
- onRestart: restart,
26630
- onToggleChapters: toggleChapters,
26631
- onToggleCaptions: toggleCaptions,
26632
- onOpenSettings: () => settingsMenuDispatch(settingsMenuActions.toggle()),
26633
- onToggleDock: toggleDock,
26634
- onChapterClick: (index) => navigateToChapter(index)
26635
- }
26636
- ),
26637
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ErrorBoundary, { componentName: "SettingsMenu", minimal: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react53.default.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26638
- SettingsMenu3,
26639
- {
26640
- show: showSettingsMenu,
26641
- showControls,
26642
- isFullscreen,
26643
- menuLevel: settingsMenuLevel,
26644
- captions: effectiveCaptions,
26645
- captionsEnabled,
26646
- selectedLanguage,
26647
- playbackRate,
26648
- qualityLevels,
26649
- currentQualityLevel,
26650
- brandColor,
26651
- onNavigateToSubmenu: navigateToSettingsSubmenu,
26652
- onNavigateBack: navigateBackInSettings,
26653
- onClose: resetSettingsMenu,
26654
- onCaptionSelect: handleCaptionSelect,
26655
- onPlaybackRateChange: changePlaybackRate,
26656
- onQualitySelect: handleQualitySelect
26657
- }
26658
- ) }) }),
26659
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ErrorBoundary, { componentName: "DockPanel", minimal: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react53.default.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26660
- DockPanel3,
26661
- {
26662
- show: showDock,
26663
- showControls,
26664
- containerWidth: containerDimensions.width,
26665
- activeTab: activeDockTab,
26666
- onTabChange: handleDockTabChange,
26667
- chapters: chaptersData,
26668
- currentChapter,
26669
- onChapterSelect: seek,
26670
- transcriptData,
26671
- currentTime,
26672
- onTranscriptSelect: seekToTranscriptPosition,
26673
- captions: effectiveCaptions,
26674
- selectedLanguage,
26675
- onLanguageChange: handleDockLanguageChange,
26676
- brandColor,
26677
- dockRef,
26678
- onClose: toggleDock,
26679
- playlist: effectivePlaylist,
26680
- currentVideoId: currentPlaylistItem == null ? void 0 : currentPlaylistItem.id,
26681
- onPlaylistSelect: handlePlaylistSelect,
26682
- isShuffleEnabled,
26683
- onToggleShuffle: toggleShuffle,
26684
- shuffleQueue: isShuffleEnabled ? getQueueOrder() : void 0,
26685
- playedIndices: isShuffleEnabled ? getPlayedIndices() : void 0,
26686
- nowPlayingTitle: videoTitle || "Video Playground",
26687
- onTabInteract: handleDockTabChange
26688
- }
26689
- ) }) })
26690
- ]
26691
- }
26692
- ) }),
26693
- showTranscript && transcriptData.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26694
- VideoTranscript2,
26695
- {
26696
- transcriptData,
26697
- currentTime,
26698
- onSeek: seekToTranscriptPosition
26699
- }
26700
- )
26701
- ] });
26467
+ style: {
26468
+ objectFit,
26469
+ filter: mobileOptimization.isMobile ? `brightness(${brightnessLevel})` : void 0
26470
+ },
26471
+ playsInline: true,
26472
+ "webkit-playsinline": "true",
26473
+ crossOrigin: "anonymous",
26474
+ autoPlay: autoplay,
26475
+ muted: autoplay ? true : muted,
26476
+ preload: autoplay ? "auto" : batteryOptimization.lowPowerMode ? "none" : connectionOptimization.saveData ? "metadata" : "auto",
26477
+ onPlay: videoEventHandlers.onPlay,
26478
+ onPause: videoEventHandlers.onPause,
26479
+ onEnded: videoEventHandlers.onEnded,
26480
+ onTimeUpdate: videoEventHandlers.onTimeUpdate,
26481
+ onVolumeChange: videoEventHandlers.onVolumeChange,
26482
+ onRateChange: videoEventHandlers.onRateChange,
26483
+ onLoadStart: videoEventHandlers.onLoadStart,
26484
+ onLoadedMetadata: videoEventHandlers.onLoadedMetadata,
26485
+ onCanPlay: videoEventHandlers.onCanPlay,
26486
+ onWaiting: videoEventHandlers.onWaiting,
26487
+ onError: videoEventHandlers.onError,
26488
+ onSeeking: videoEventHandlers.onSeeking,
26489
+ onSeeked: videoEventHandlers.onSeeked
26490
+ }
26491
+ ),
26492
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AnimatePresence, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26493
+ PosterOverlay,
26494
+ {
26495
+ isVisible: !!poster && showPoster,
26496
+ posterUrl: poster,
26497
+ onPlay: togglePlay,
26498
+ onPosterLoad: () => {
26499
+ debugLog("\u2705 Poster loaded successfully");
26500
+ contentDispatch(contentActions.setLoaded(true));
26501
+ },
26502
+ onPosterError: () => {
26503
+ console.error("\u274C Failed to load poster image:", poster);
26504
+ contentDispatch(contentActions.error());
26505
+ },
26506
+ brandColor
26507
+ }
26508
+ ) }),
26509
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AnimatePresence, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26510
+ LoadingSpinner,
26511
+ {
26512
+ isVisible: isBuffering,
26513
+ brandColor,
26514
+ size: "md"
26515
+ }
26516
+ ) }),
26517
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26518
+ PasswordDialog,
26519
+ {
26520
+ isOpen: showPasswordDialog,
26521
+ password: passwordInput,
26522
+ onPasswordChange: (value) => authDispatch(authActions.setPasswordInput(value)),
26523
+ onSubmit: handlePasswordSubmit,
26524
+ onCancel: handlePasswordCancel,
26525
+ isLoading: isAuthenticating,
26526
+ error: passwordError,
26527
+ brandColor
26528
+ }
26529
+ ),
26530
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AnimatePresence, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26531
+ ErrorDisplay,
26532
+ {
26533
+ isVisible: hasError,
26534
+ error,
26535
+ onRetry: retry,
26536
+ brandColor
26537
+ }
26538
+ ) }),
26539
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react53.default.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26540
+ VideoOverlays2,
26541
+ {
26542
+ showSkipIndicator,
26543
+ isPictureInPicture,
26544
+ isSeeking,
26545
+ seekingTime,
26546
+ duration,
26547
+ isPlaying,
26548
+ isBuffering,
26549
+ hasError,
26550
+ showSeekbarTutorial,
26551
+ showPoster,
26552
+ showControls,
26553
+ currentUrl,
26554
+ videoTitle: (currentPlaylistItem == null ? void 0 : currentPlaylistItem.title) || videoTitle,
26555
+ playbackRate,
26556
+ showGestureIndicator,
26557
+ gestureType,
26558
+ volume,
26559
+ brightnessLevel,
26560
+ watermark: effectiveWatermark,
26561
+ brandColor,
26562
+ onTogglePlay: togglePlay
26563
+ }
26564
+ ) }),
26565
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ErrorBoundary, { componentName: "CaptionOverlay", minimal: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26566
+ CaptionOverlay,
26567
+ {
26568
+ captionsEnabled,
26569
+ currentCaption,
26570
+ containerWidth: containerDimensions.width,
26571
+ showControls
26572
+ }
26573
+ ) }),
26574
+ showUpNext && hasNextTrack && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26575
+ UpNextOverlay,
26576
+ {
26577
+ nextVideoTitle: (() => {
26578
+ var _a;
26579
+ const idx = peekNextIndex();
26580
+ return idx !== null ? ((_a = effectivePlaylist.items[idx]) == null ? void 0 : _a.title) || "Next Video" : "Next Video";
26581
+ })(),
26582
+ countdownSeconds: upNextCountdown,
26583
+ isPaused: !isPlaying,
26584
+ brandColor,
26585
+ onPlayNext: () => {
26586
+ setShowUpNext(false);
26587
+ handleNextTrack();
26588
+ },
26589
+ onCancel: () => {
26590
+ setUpNextCancelled(true);
26591
+ setShowUpNext(false);
26592
+ toast2({
26593
+ title: "Auto-play cancelled",
26594
+ description: "Video will stop at the end.",
26595
+ duration: 2e3
26596
+ });
26597
+ }
26598
+ }
26599
+ ),
26600
+ !showSeekbarTutorial && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26601
+ ControlBar,
26602
+ {
26603
+ isPlaying,
26604
+ currentTime,
26605
+ duration,
26606
+ buffered,
26607
+ isBuffering,
26608
+ playbackRate,
26609
+ volume,
26610
+ isMuted,
26611
+ isFullscreen,
26612
+ isPictureInPicture,
26613
+ pipSupported,
26614
+ pipButtonDisabled: pipButtonState.disabled,
26615
+ pipButtonReason: pipButtonState.reason,
26616
+ showControls,
26617
+ containerWidth: containerDimensions.width,
26618
+ brandColor,
26619
+ showChaptersButton: chaptersData.length > 0,
26620
+ showCaptionsButton: effectiveCaptions.length > 0,
26621
+ showSettingsButton: true,
26622
+ showPipButton: containerDimensions.width >= 640,
26623
+ showDockButton: chaptersData.length > 0 || transcriptData.length > 0,
26624
+ showPlaylistButton: effectivePlaylist.items.length > 0,
26625
+ onTogglePlaylist: handleTogglePlaylist,
26626
+ onNextTrack: handleNextTrack,
26627
+ onPrevTrack: handlePrevTrack,
26628
+ hasNextTrack,
26629
+ hasPrevTrack,
26630
+ isPlaylistMode,
26631
+ hasChapters: chaptersData.length > 0,
26632
+ hasCaptions: effectiveCaptions.length > 0,
26633
+ captionsEnabled,
26634
+ showDock,
26635
+ chapters: chaptersData,
26636
+ currentChapter: currentChapter != null ? currentChapter : void 0,
26637
+ onTogglePlay: togglePlay,
26638
+ onSkip: skip,
26639
+ onSeek: seek,
26640
+ onVolumeChange: changeVolume,
26641
+ onToggleMute: toggleMute,
26642
+ onToggleFullscreen: toggleFullscreen,
26643
+ onTogglePip: togglePictureInPicture,
26644
+ onRestart: restart,
26645
+ onToggleChapters: toggleChapters,
26646
+ onToggleCaptions: toggleCaptions,
26647
+ onOpenSettings: () => settingsMenuDispatch(settingsMenuActions.toggle()),
26648
+ onToggleDock: toggleDock,
26649
+ onChapterClick: (index) => navigateToChapter(index)
26650
+ }
26651
+ ),
26652
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ErrorBoundary, { componentName: "SettingsMenu", minimal: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react53.default.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26653
+ SettingsMenu3,
26654
+ {
26655
+ show: showSettingsMenu,
26656
+ showControls,
26657
+ isFullscreen,
26658
+ menuLevel: settingsMenuLevel,
26659
+ captions: effectiveCaptions,
26660
+ captionsEnabled,
26661
+ selectedLanguage,
26662
+ playbackRate,
26663
+ qualityLevels,
26664
+ currentQualityLevel,
26665
+ brandColor,
26666
+ onNavigateToSubmenu: navigateToSettingsSubmenu,
26667
+ onNavigateBack: navigateBackInSettings,
26668
+ onClose: resetSettingsMenu,
26669
+ onCaptionSelect: handleCaptionSelect,
26670
+ onPlaybackRateChange: changePlaybackRate,
26671
+ onQualitySelect: handleQualitySelect
26672
+ }
26673
+ ) }) }),
26674
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ErrorBoundary, { componentName: "DockPanel", minimal: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react53.default.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26675
+ DockPanel3,
26676
+ {
26677
+ show: showDock,
26678
+ showControls,
26679
+ containerWidth: containerDimensions.width,
26680
+ activeTab: activeDockTab,
26681
+ onTabChange: handleDockTabChange,
26682
+ chapters: chaptersData,
26683
+ currentChapter,
26684
+ onChapterSelect: seek,
26685
+ transcriptData,
26686
+ currentTime,
26687
+ onTranscriptSelect: seekToTranscriptPosition,
26688
+ captions: effectiveCaptions,
26689
+ selectedLanguage,
26690
+ onLanguageChange: handleDockLanguageChange,
26691
+ brandColor,
26692
+ dockRef,
26693
+ onClose: toggleDock,
26694
+ playlist: effectivePlaylist,
26695
+ currentVideoId: currentPlaylistItem == null ? void 0 : currentPlaylistItem.id,
26696
+ onPlaylistSelect: handlePlaylistSelect,
26697
+ isShuffleEnabled,
26698
+ onToggleShuffle: toggleShuffle,
26699
+ shuffleQueue: isShuffleEnabled ? getQueueOrder() : void 0,
26700
+ playedIndices: isShuffleEnabled ? getPlayedIndices() : void 0,
26701
+ nowPlayingTitle: videoTitle || "Video Playground",
26702
+ onTabInteract: handleDockTabChange
26703
+ }
26704
+ ) }) })
26705
+ ]
26706
+ }
26707
+ ) }),
26708
+ showTranscript && transcriptData.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
26709
+ VideoTranscript2,
26710
+ {
26711
+ transcriptData,
26712
+ currentTime,
26713
+ onSeek: seekToTranscriptPosition
26714
+ }
26715
+ )
26716
+ ]
26717
+ }
26718
+ );
26702
26719
  }
26703
26720
  SimpleVideoPlayer.displayName = "SimpleVideoPlayer";
26704
26721
  function SimpleVideoPlayerWithContext(props) {
26705
26722
  const config = (0, import_react53.useMemo)(
26706
26723
  () => ({
26707
- defaultUrl: props.hyperstreamUrl || "",
26724
+ defaultUrl: props.url || props.hyperstreamUrl || "",
26708
26725
  autoplay: props.autoplay,
26709
26726
  muted: props.muted,
26710
- poster: props.poster,
26727
+ poster: props.thumbnail || props.poster,
26711
26728
  watermark: props.watermark,
26712
- brandColor: props.brandColor,
26729
+ brandColor: props.primaryColor || props.brandColor,
26713
26730
  objectFit: props.objectFit
26714
26731
  }),
26715
26732
  [
26733
+ props.url,
26716
26734
  props.hyperstreamUrl,
26717
26735
  props.autoplay,
26718
26736
  props.muted,
26737
+ props.thumbnail,
26719
26738
  props.poster,
26720
26739
  props.watermark,
26740
+ props.primaryColor,
26721
26741
  props.brandColor,
26722
26742
  props.objectFit
26723
26743
  ]