@livo-tv/blocks 1.27.0 → 1.28.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.cjs +16 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4998,6 +4998,18 @@ function VideoPlayer({
|
|
|
4998
4998
|
setLevel(index);
|
|
4999
4999
|
setOpenMenu(null);
|
|
5000
5000
|
}
|
|
5001
|
+
function chooseCaption(locale) {
|
|
5002
|
+
setCaptionLocale(locale);
|
|
5003
|
+
setOpenMenu(null);
|
|
5004
|
+
}
|
|
5005
|
+
function toggleControls() {
|
|
5006
|
+
setOpenMenu(null);
|
|
5007
|
+
setControlsVisible((current) => {
|
|
5008
|
+
const next = !current;
|
|
5009
|
+
if (next) scheduleHide();
|
|
5010
|
+
return next;
|
|
5011
|
+
});
|
|
5012
|
+
}
|
|
5001
5013
|
function handleKeyDown(e) {
|
|
5002
5014
|
if (!active) return;
|
|
5003
5015
|
switch (e.key) {
|
|
@@ -5063,7 +5075,7 @@ function VideoPlayer({
|
|
|
5063
5075
|
}
|
|
5064
5076
|
const VolumeIcon = isMuted || volume === 0 ? lucideReact.VolumeX : volume < 0.5 ? lucideReact.Volume1 : lucideReact.Volume2;
|
|
5065
5077
|
const showSpinner = active && (state === "loading" || state === "waiting");
|
|
5066
|
-
const showControls = active && state === "ready" &&
|
|
5078
|
+
const showControls = active && state === "ready" && controlsVisible;
|
|
5067
5079
|
const showPoster = !active && !!poster;
|
|
5068
5080
|
const currentLevelLabel = activeLevel < 0 ? t.auto : `${qualities.find((q) => q.index === activeLevel)?.height ?? ""}p`;
|
|
5069
5081
|
const showQuality = showQualitySelector && qualities.length > 1;
|
|
@@ -5098,7 +5110,7 @@ function VideoPlayer({
|
|
|
5098
5110
|
playsInline: true,
|
|
5099
5111
|
muted: isMuted,
|
|
5100
5112
|
className: "livo-video-player-media h-full w-full bg-black object-contain",
|
|
5101
|
-
onClick: active ?
|
|
5113
|
+
onClick: active ? toggleControls : void 0,
|
|
5102
5114
|
poster,
|
|
5103
5115
|
children: !liveCaptionsBaseUrl ? CAPTION_LOCALES.map((locale) => {
|
|
5104
5116
|
const url = captionsVttUrlFromPlayback(src, locale);
|
|
@@ -5261,7 +5273,7 @@ function VideoPlayer({
|
|
|
5261
5273
|
MenuItem,
|
|
5262
5274
|
{
|
|
5263
5275
|
selected: captionLocale === "off",
|
|
5264
|
-
onSelect: () =>
|
|
5276
|
+
onSelect: () => chooseCaption("off"),
|
|
5265
5277
|
children: t.captionsOff
|
|
5266
5278
|
}
|
|
5267
5279
|
),
|
|
@@ -5269,7 +5281,7 @@ function VideoPlayer({
|
|
|
5269
5281
|
MenuItem,
|
|
5270
5282
|
{
|
|
5271
5283
|
selected: captionLocale === locale,
|
|
5272
|
-
onSelect: () =>
|
|
5284
|
+
onSelect: () => chooseCaption(locale),
|
|
5273
5285
|
children: captionLocaleLabel(locale, t)
|
|
5274
5286
|
},
|
|
5275
5287
|
locale
|