@bendyline/squisq-react 2.11.17 → 2.11.18
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/{chunk-622IA3KB.js → chunk-CB2MCXJ6.js} +24 -2
- package/dist/index.js +1 -1
- package/dist/player/index.js +1 -1
- package/dist/squisq-player.full.global.js +371 -371
- package/dist/squisq-player.global.js +64 -64
- package/dist/standalone-player-full.js +1 -1
- package/dist/standalone-source.js +1 -1
- package/package.json +2 -2
|
@@ -3167,6 +3167,28 @@ function DocPlayerContent({
|
|
|
3167
3167
|
});
|
|
3168
3168
|
}, [onCaptionsToggle]);
|
|
3169
3169
|
const hasCaptions = doc.captions && doc.captions.phrases.length > 0;
|
|
3170
|
+
const [frameSize, setFrameSize] = useState6(null);
|
|
3171
|
+
useEffect7(() => {
|
|
3172
|
+
const frame = containerRef.current;
|
|
3173
|
+
if (!frame || renderMode || !hasCaptions) return;
|
|
3174
|
+
const measure = () => {
|
|
3175
|
+
const width = frame.offsetWidth;
|
|
3176
|
+
const height = frame.offsetHeight;
|
|
3177
|
+
if (width <= 0 || height <= 0) return;
|
|
3178
|
+
setFrameSize(
|
|
3179
|
+
(prev) => prev && prev.width === width && prev.height === height ? prev : { width, height }
|
|
3180
|
+
);
|
|
3181
|
+
};
|
|
3182
|
+
measure();
|
|
3183
|
+
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
|
|
3184
|
+
observer?.observe(frame);
|
|
3185
|
+
window.addEventListener("resize", measure);
|
|
3186
|
+
return () => {
|
|
3187
|
+
observer?.disconnect();
|
|
3188
|
+
window.removeEventListener("resize", measure);
|
|
3189
|
+
};
|
|
3190
|
+
}, [renderMode, hasCaptions, isLinearMode, isDashboardMode]);
|
|
3191
|
+
const captionViewport = !renderMode && frameSize ? { ...activeViewport, ...frameSize } : activeViewport;
|
|
3170
3192
|
const segmentTitleMap = useMemo5(() => buildSegmentTitleMap(doc), [doc]);
|
|
3171
3193
|
const playbackState = useMemo5(
|
|
3172
3194
|
() => ({
|
|
@@ -3652,11 +3674,11 @@ function DocPlayerContent({
|
|
|
3652
3674
|
captions: doc.captions,
|
|
3653
3675
|
currentTime,
|
|
3654
3676
|
enabled: captionsEnabled && (renderMode || isPlaying || currentTime > 0),
|
|
3655
|
-
fontSize: Math.min(34, Math.max(16, Math.round(
|
|
3677
|
+
fontSize: Math.min(34, Math.max(16, Math.round(captionViewport.height * 0.026))),
|
|
3656
3678
|
captionStyle: activeCaptionStyle,
|
|
3657
3679
|
captionPosition,
|
|
3658
3680
|
theme: effectiveTheme,
|
|
3659
|
-
viewport:
|
|
3681
|
+
viewport: captionViewport
|
|
3660
3682
|
}
|
|
3661
3683
|
),
|
|
3662
3684
|
isDebugMode && /* @__PURE__ */ jsxs6(
|
package/dist/index.js
CHANGED
package/dist/player/index.js
CHANGED