@bendyline/squisq-react 2.3.3 → 2.4.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/README.md +4 -0
- package/dist/{chunk-NWZQGZIJ.js → chunk-BOZJ655L.js} +10 -4
- package/dist/{chunk-IUFWLNXS.js → chunk-EKD6JMJN.js} +627 -164
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +1 -1
- package/dist/index.d.ts +56 -4
- package/dist/index.js +7 -3
- package/dist/player/index.d.ts +50 -4
- package/dist/player/index.js +2 -2
- package/dist/squisq-player.full.global.js +463 -461
- package/dist/squisq-player.global.js +65 -63
- package/dist/standalone-source.js +1 -1
- package/dist/styles/index.css +68 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -125,6 +125,10 @@ Interactive mount:
|
|
|
125
125
|
|
|
126
126
|
For headless capture, add `renderMode: true`, then await
|
|
127
127
|
`handle.renderAPI` before calling `seekTo()` or reading render metadata.
|
|
128
|
+
`seekTo()` resolves only after React has committed the requested visual time,
|
|
129
|
+
CSS animations have been positioned, active video has produced its sought
|
|
130
|
+
frame, and one final paint opportunity has completed. `getRenderedTime()`
|
|
131
|
+
returns the timeline time represented by the committed DOM.
|
|
128
132
|
TypeScript hosts can import `MountOptions` and `SquisqPlayerHandle` from the
|
|
129
133
|
package root.
|
|
130
134
|
|
|
@@ -483,7 +483,12 @@ import {
|
|
|
483
483
|
VIEWPORT_PRESETS
|
|
484
484
|
} from "@bendyline/squisq/doc";
|
|
485
485
|
function useDocPlayback(script, currentTime, options = {}) {
|
|
486
|
-
const {
|
|
486
|
+
const {
|
|
487
|
+
viewport = VIEWPORT_PRESETS.landscape,
|
|
488
|
+
theme,
|
|
489
|
+
onSeek,
|
|
490
|
+
useAudioSegmentTiming = true
|
|
491
|
+
} = options;
|
|
487
492
|
const blocks = useMemo2(() => {
|
|
488
493
|
if (!script?.blocks) {
|
|
489
494
|
return [];
|
|
@@ -497,10 +502,10 @@ function useDocPlayback(script, currentTime, options = {}) {
|
|
|
497
502
|
resolvedTheme
|
|
498
503
|
);
|
|
499
504
|
if (hasTemplates) {
|
|
500
|
-
const audioSegments = script.audio?.segments?.map((seg) => ({
|
|
505
|
+
const audioSegments = useAudioSegmentTiming ? script.audio?.segments?.map((seg) => ({
|
|
501
506
|
startTime: seg.startTime,
|
|
502
507
|
duration: seg.duration
|
|
503
|
-
}));
|
|
508
|
+
})) : void 0;
|
|
504
509
|
const expanded = expandDocBlocks(flatBlocks, {
|
|
505
510
|
audioSegments,
|
|
506
511
|
viewport,
|
|
@@ -524,7 +529,8 @@ function useDocPlayback(script, currentTime, options = {}) {
|
|
|
524
529
|
script?.persistentLayers,
|
|
525
530
|
script?.customTemplates,
|
|
526
531
|
viewport,
|
|
527
|
-
theme
|
|
532
|
+
theme,
|
|
533
|
+
useAudioSegmentTiming
|
|
528
534
|
]);
|
|
529
535
|
const currentBlock = useMemo2(() => getBlockAtTime(blocks, currentTime), [blocks, currentTime]);
|
|
530
536
|
const currentBlockIndex = useMemo2(
|