@livo-tv/blocks 1.9.0 → 1.10.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 +11 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3882,8 +3882,13 @@ function parseCaptionVtt(text) {
|
|
|
3882
3882
|
}
|
|
3883
3883
|
return cues;
|
|
3884
3884
|
}
|
|
3885
|
-
function captionAtTime(cues, time) {
|
|
3886
|
-
|
|
3885
|
+
function captionAtTime(cues, time, options) {
|
|
3886
|
+
const matched = cues.find((cue) => time >= cue.start && time < cue.end) ?? null;
|
|
3887
|
+
if (matched) return matched;
|
|
3888
|
+
if (options?.live && cues.length > 0) {
|
|
3889
|
+
return cues[cues.length - 1] ?? null;
|
|
3890
|
+
}
|
|
3891
|
+
return null;
|
|
3887
3892
|
}
|
|
3888
3893
|
async function loadCaptionVtt(url) {
|
|
3889
3894
|
try {
|
|
@@ -4147,7 +4152,9 @@ function VideoPlayer({
|
|
|
4147
4152
|
window.clearInterval(timer);
|
|
4148
4153
|
};
|
|
4149
4154
|
}, [captionLocale, liveCaptionsBaseUrl, src]);
|
|
4150
|
-
const activeCaption = captionAtTime(captionCues, currentTime
|
|
4155
|
+
const activeCaption = captionAtTime(captionCues, currentTime, {
|
|
4156
|
+
live: Boolean(liveCaptionsBaseUrl)
|
|
4157
|
+
});
|
|
4151
4158
|
function togglePlay() {
|
|
4152
4159
|
const video = videoRef.current;
|
|
4153
4160
|
if (!video) return;
|
|
@@ -5038,7 +5045,7 @@ function FileUploadTray({
|
|
|
5038
5045
|
/* @__PURE__ */ jsx(
|
|
5039
5046
|
"p",
|
|
5040
5047
|
{
|
|
5041
|
-
className: "
|
|
5048
|
+
className: "min-w-0 line-clamp-3 text-sm leading-5 font-medium break-all",
|
|
5042
5049
|
title: job.name,
|
|
5043
5050
|
children: job.name
|
|
5044
5051
|
}
|