@livo-tv/blocks 1.34.0 → 1.36.0-rc.1

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/video.cjs CHANGED
@@ -2730,13 +2730,13 @@ function captionDwellMs(text, backlog = 0) {
2730
2730
  const max = backlog > 0 ? CAPTION_RUSH_DWELL_MS : CAPTION_MAX_DWELL_MS;
2731
2731
  return Math.min(max, Math.max(CAPTION_MIN_DWELL_MS, raw));
2732
2732
  }
2733
- function advanceLiveCaptionPlayout(state, cues, now, lagMs, maxCharsPerLine = CAPTION_MAX_CHARS_PER_LINE) {
2733
+ function advanceLiveCaptionPlayout(state, cues, now, lagMs, maxCharsPerLine = CAPTION_MAX_CHARS_PER_LINE, extraLagMs = LIVE_CUE_EXTRA_LAG_MS) {
2734
2734
  let screen = state.screen;
2735
2735
  let hideAt = state.hideAt;
2736
2736
  let cursor = state.cursor;
2737
2737
  let queue = state.queue.slice();
2738
2738
  if (lagMs != null && Number.isFinite(lagMs) && lagMs >= 0) {
2739
- const threshold = lagMs + LIVE_CUE_EXTRA_LAG_MS;
2739
+ const threshold = lagMs + extraLagMs;
2740
2740
  const incoming = cues.filter(
2741
2741
  (cue) => Boolean(cue.text.trim()) && Number.isFinite(cue.receivedAt) && cue.receivedAt > cursor && now - cue.receivedAt >= threshold
2742
2742
  ).sort((left, right) => left.receivedAt - right.receivedAt);
@@ -3535,7 +3535,11 @@ function isEmbeddedWindow(win = window) {
3535
3535
  return true;
3536
3536
  }
3537
3537
  }
3538
- function CaptionOverlay({ screen }) {
3538
+ function CaptionOverlay({
3539
+ screen,
3540
+ className,
3541
+ textClassName
3542
+ }) {
3539
3543
  const lastSpeakerRef = React11__namespace.useRef(void 0);
3540
3544
  const lastSpeaker = lastSpeakerRef.current;
3541
3545
  React11__namespace.useLayoutEffect(() => {
@@ -3547,14 +3551,20 @@ function CaptionOverlay({ screen }) {
3547
3551
  return /* @__PURE__ */ jsxRuntime.jsx(
3548
3552
  "div",
3549
3553
  {
3550
- className: "pointer-events-none absolute inset-x-0 bottom-16 z-[1] flex justify-center px-4",
3554
+ className: cn(
3555
+ "pointer-events-none absolute inset-x-0 bottom-16 z-[1] flex justify-center px-4",
3556
+ className
3557
+ ),
3551
3558
  "data-slot": "video-captions",
3552
3559
  children: /* @__PURE__ */ jsxRuntime.jsx(
3553
3560
  "p",
3554
3561
  {
3555
3562
  role: "status",
3556
3563
  "aria-live": "polite",
3557
- className: "line-clamp-2 max-w-[90%] whitespace-pre-line break-words rounded-sm bg-black/70 px-3 py-1.5 text-center text-[length:clamp(10px,2.6cqh,0.875rem)] font-medium text-white shadow-sm [-webkit-text-size-adjust:100%] [text-size-adjust:100%]",
3564
+ className: cn(
3565
+ "line-clamp-2 max-w-[90%] whitespace-pre-line break-words rounded-sm bg-black/70 px-3 py-1.5 text-center text-[length:clamp(10px,2.6cqh,0.875rem)] font-medium text-white shadow-sm [-webkit-text-size-adjust:100%] [text-size-adjust:100%]",
3566
+ textClassName
3567
+ ),
3558
3568
  children: text
3559
3569
  }
3560
3570
  )
@@ -5094,6 +5104,7 @@ function createPlaybackBeaconClient({
5094
5104
  }
5095
5105
 
5096
5106
  exports.CAPTION_LOCALES = CAPTION_LOCALES;
5107
+ exports.CaptionOverlay = CaptionOverlay;
5097
5108
  exports.CurtainPicker = CurtainPicker;
5098
5109
  exports.CurtainPickerSkeleton = CurtainPickerSkeleton;
5099
5110
  exports.CurtainPreview = CurtainPreview;
@@ -5101,12 +5112,14 @@ exports.CurtainStage = CurtainStage;
5101
5112
  exports.DEFAULT_CURTAIN_PICKER_LABELS = DEFAULT_CURTAIN_PICKER_LABELS;
5102
5113
  exports.DEFAULT_SHADER_CURTAIN_CONFIG = DEFAULT_SHADER_CURTAIN_CONFIG;
5103
5114
  exports.DEFAULT_SHADER_CURTAIN_EDITOR_LABELS = DEFAULT_SHADER_CURTAIN_EDITOR_LABELS;
5115
+ exports.EMPTY_LIVE_CAPTION_PLAYOUT = EMPTY_LIVE_CAPTION_PLAYOUT;
5104
5116
  exports.FeedVideoPlayer = FeedVideoPlayer;
5105
5117
  exports.SHADER_CURTAIN_PRESETS = SHADER_CURTAIN_PRESETS;
5106
5118
  exports.ShaderCurtain = ShaderCurtain;
5107
5119
  exports.ShaderCurtainEditor = ShaderCurtainEditor;
5108
5120
  exports.VideoPlayer = VideoPlayer;
5109
5121
  exports.WaitingRoom = WaitingRoom;
5122
+ exports.advanceLiveCaptionPlayout = advanceLiveCaptionPlayout;
5110
5123
  exports.captionsVttUrlFromPlayback = captionsVttUrlFromPlayback;
5111
5124
  exports.captureShaderPoster = captureShaderPoster;
5112
5125
  exports.castHlsUrl = castHlsUrl;
@@ -5117,7 +5130,10 @@ exports.describeAvResync = describeAvResync;
5117
5130
  exports.describePlaybackError = describePlaybackError;
5118
5131
  exports.isCaptionLocale = isCaptionLocale;
5119
5132
  exports.isShaderCurtainKind = isShaderCurtainKind;
5133
+ exports.liveCaptionsUrl = liveCaptionsUrl;
5120
5134
  exports.loadCastSender = loadCastSender;
5135
+ exports.loadLiveCaptions = loadLiveCaptions;
5136
+ exports.mergeLiveCaptionCues = mergeLiveCaptionCues;
5121
5137
  exports.mergeShaderCurtainConfig = mergeShaderCurtainConfig;
5122
5138
  exports.parseShaderGradientUrl = parseShaderGradientUrl;
5123
5139
  exports.shouldRetryLiveEdge404 = shouldRetryLiveEdge404;