@vanillaskyai/video 0.5.8 → 0.6.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/CHANGELOG.md +21 -0
- package/PUBLIC-API.md +6 -0
- package/README.md +8 -0
- package/dist/{bg-media-FEBATBT2.js → bg-media-G4XOQEAS.js} +3 -3
- package/dist/{brand-message-P56WEJPG.js → brand-message-XHONEDNW.js} +3 -3
- package/dist/{chart-bar-ZB45ZRKH.js → chart-bar-HRHD57ML.js} +3 -3
- package/dist/{chart-counter-HFYNE4HT.js → chart-counter-KFPV44RB.js} +3 -3
- package/dist/{chart-progress-ring-ZKMLRGSB.js → chart-progress-ring-OR2VOIHV.js} +3 -3
- package/dist/check-runtime.js +2 -2
- package/dist/chunk-5CDAM24P.js +31 -0
- package/dist/{chunk-6M6DATLW.js → chunk-7BGAU6C3.js} +4 -4
- package/dist/{chunk-HT6BGERF.js → chunk-FRN6WKHA.js} +28 -10
- package/dist/{chunk-NGY3TNND.js → chunk-K746NUIP.js} +70 -50
- package/dist/{cta-logo-S4OMTNXD.js → cta-logo-JJOGK4UC.js} +3 -3
- package/dist/{cta-media-EROTHDRR.js → cta-media-IQ3MAWEH.js} +3 -3
- package/dist/{incoming-call-5IWJ2TAS.js → incoming-call-KXF67OT2.js} +3 -3
- package/dist/{infographic-feature-list-7SK65U3K.js → infographic-feature-list-QDM4I7XE.js} +3 -3
- package/dist/{infographic-problem-solution-IW35S6BR.js → infographic-problem-solution-FMLJCPG6.js} +3 -3
- package/dist/{infographic-stat-row-XHUZZPDM.js → infographic-stat-row-VFTIXS5F.js} +3 -3
- package/dist/{infographic-steps-JDDEDI7X.js → infographic-steps-L7W24Z35.js} +3 -3
- package/dist/{prompt-input-6ZWXEL3V.js → prompt-input-F3CYU2XH.js} +3 -3
- package/dist/react.d.ts +6 -0
- package/dist/react.js +33 -26
- package/dist/{reaction-Z3JIM3MQ.js → reaction-2XCLOJOK.js} +3 -3
- package/dist/{scene-video-backdrop-IL4F2SVD.js → scene-video-backdrop-XFPX4O3I.js} +2 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.js +5 -0
- package/dist/{showcase-code-NWQAAJIA.js → showcase-code-KHSMIPG6.js} +3 -3
- package/dist/{showcase-phone-5UW45ATT.js → showcase-phone-M4CEANIW.js} +3 -3
- package/dist/{showcase-terminal-UVOD25UF.js → showcase-terminal-26I3DYF7.js} +3 -3
- package/dist/{showcase-web-3AW6VHIG.js → showcase-web-TY6CZV2Z.js} +3 -3
- package/dist/{social-milestone-KPKHFOB5.js → social-milestone-TF6MX7ET.js} +3 -3
- package/dist/{social-notification-EDOU6TZB.js → social-notification-2RJDAZSF.js} +3 -3
- package/dist/{social-review-stack-EZOO33SV.js → social-review-stack-2ICKJQG7.js} +3 -3
- package/dist/{social-testimonial-DLOINMMY.js → social-testimonial-X7OGADA3.js} +3 -3
- package/dist/{social-tweet-6JUM323G.js → social-tweet-TK7SH2F6.js} +3 -3
- package/docs/media-and-audio.md +59 -0
- package/examples/nextjs-quickstart/package.json +1 -1
- package/examples/nextjs-quickstart/src/app/api/video/route.ts +13 -4
- package/examples/server-integrations/README.md +20 -0
- package/examples/server-integrations/src/ai-sdk-media.ts +90 -0
- package/package.json +2 -1
- package/registry/items/backgrounds.json +2 -2
- package/dist/chunk-C6WVCZRW.js +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,27 @@ VanillaSky follows semantic versioning. This changelog begins with the 0.1 beta.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 0.6.0
|
|
8
|
+
|
|
9
|
+
- Adds opt-in native scene-video audio to `VideoPlayer`, mixed with the existing
|
|
10
|
+
continuous soundtrack layer under one master mute control. Applications set
|
|
11
|
+
the embedded clip level with `nativeMediaAudio.volume`; the serialized
|
|
12
|
+
soundtrack retains its independent `audio.volume`.
|
|
13
|
+
- Passes `requestId` and the resolving `scene` to the server `resolveMedia`
|
|
14
|
+
callback, so applications can generate, attribute, and cache media per scene.
|
|
15
|
+
- Documents a provider-neutral app-owned media generation adapter in
|
|
16
|
+
`examples/server-integrations/src/ai-sdk-media.ts`. Generation stays outside
|
|
17
|
+
the SDK install: the application supplies the AI SDK model and storage.
|
|
18
|
+
- Extends the isolated rich-media consumer POC with an adaptive `/channel`
|
|
19
|
+
route: structured scene intent, deterministic stock/image/H3 Max routing,
|
|
20
|
+
manual overrides, explicit character/keyframe continuity, factual-safe
|
|
21
|
+
fallbacks, cancellation, deadline-aware generation, and a bounded
|
|
22
|
+
current-plus-next segment queue without changing the SDK API.
|
|
23
|
+
- Adds an isolated AI scene-director proof of concept where VanillaSky's trusted
|
|
24
|
+
planner chooses and explains app-owned generated imagery, varied delay-aware
|
|
25
|
+
GIF stickers, and varied progress-driven Lottie motion without changing the
|
|
26
|
+
stable SDK contract.
|
|
27
|
+
|
|
7
28
|
## 0.5.8
|
|
8
29
|
|
|
9
30
|
- Moved the public source to a fresh repository at
|
package/PUBLIC-API.md
CHANGED
|
@@ -191,6 +191,12 @@ mounted player autoplay with sound after the first successful viewer start.
|
|
|
191
191
|
`manual`, `muted-autoplay`, and `autoplay-with-sound` cover the other browser
|
|
192
192
|
startup policies.
|
|
193
193
|
|
|
194
|
+
Set `nativeMediaAudio={{ volume: 0.85 }}` when scene video files contain an
|
|
195
|
+
embedded audio track. The active clip's audio becomes a second layer alongside
|
|
196
|
+
the video's continuous `audio` soundtrack. Both follow the player's master
|
|
197
|
+
mute control; `nativeMediaAudio.volume` and serialized `audio.volume` set their
|
|
198
|
+
independent mix levels. Incoming preroll videos remain muted until active.
|
|
199
|
+
|
|
194
200
|
`VideoInput.opening` accepts custom copy, uses the deterministic fallback when
|
|
195
201
|
omitted, and accepts `false` when the application owns transient loading UI and
|
|
196
202
|
wants the completed video to begin with the first generated scene.
|
package/README.md
CHANGED
|
@@ -10,6 +10,13 @@ playing while your LLM composes them.
|
|
|
10
10
|
Your application owns the model, data, authentication, and UI. VanillaSky owns
|
|
11
11
|
the planning prompt, trusted templates, validation, streaming, and player.
|
|
12
12
|
|
|
13
|
+
## See it first
|
|
14
|
+
|
|
15
|
+
Generate a video in the browser, with no install and no API key, in the
|
|
16
|
+
[playground](https://vanillasky.ai/playground/). The
|
|
17
|
+
[website](https://vanillasky.ai/) has the overview and full
|
|
18
|
+
[documentation](https://vanillasky.ai/docs/).
|
|
19
|
+
|
|
13
20
|
## Start
|
|
14
21
|
|
|
15
22
|
For humans:
|
|
@@ -139,6 +146,7 @@ compiler: `npm install --save-dev tsx`.
|
|
|
139
146
|
|
|
140
147
|
| Goal | Guide |
|
|
141
148
|
| --- | --- |
|
|
149
|
+
| See a video without installing | [Playground](https://vanillasky.ai/playground/) |
|
|
142
150
|
| Integrate with a coding agent | [Agent integration guide](docs/agent-integration.md) |
|
|
143
151
|
| Build the first response | [Getting started](docs/getting-started.md) |
|
|
144
152
|
| Copy the Next.js route and component | [Next.js integration](docs/integrate-nextjs.md) |
|
|
@@ -5,18 +5,18 @@ import "./chunk-QAAO7OAY.js";
|
|
|
5
5
|
import {
|
|
6
6
|
SceneBackground,
|
|
7
7
|
getMediaBackgroundProps
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7BGAU6C3.js";
|
|
9
9
|
import {
|
|
10
10
|
TemplateText
|
|
11
11
|
} from "./chunk-TCEHK2BW.js";
|
|
12
12
|
import "./chunk-L5BTTCZV.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-FRN6WKHA.js";
|
|
14
14
|
import "./chunk-W3VDIBGR.js";
|
|
15
15
|
import "./chunk-XTOXFMLM.js";
|
|
16
|
-
import "./chunk-C6WVCZRW.js";
|
|
17
16
|
import {
|
|
18
17
|
hasSceneMedia
|
|
19
18
|
} from "./chunk-224QNWRA.js";
|
|
19
|
+
import "./chunk-5CDAM24P.js";
|
|
20
20
|
import {
|
|
21
21
|
resolveTokens
|
|
22
22
|
} from "./chunk-XWWLKRNU.js";
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
SceneBackground,
|
|
6
6
|
getMediaBackgroundProps
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7BGAU6C3.js";
|
|
8
8
|
import {
|
|
9
9
|
renderWithEmoji
|
|
10
10
|
} from "./chunk-L5BTTCZV.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-FRN6WKHA.js";
|
|
12
12
|
import "./chunk-W3VDIBGR.js";
|
|
13
13
|
import {
|
|
14
14
|
interpolate
|
|
15
15
|
} from "./chunk-XTOXFMLM.js";
|
|
16
|
-
import "./chunk-C6WVCZRW.js";
|
|
17
16
|
import "./chunk-224QNWRA.js";
|
|
17
|
+
import "./chunk-5CDAM24P.js";
|
|
18
18
|
import "./chunk-XWWLKRNU.js";
|
|
19
19
|
|
|
20
20
|
// src/visual-system/primitives/typography/BrandMessageBubble.tsx
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SceneBackground,
|
|
3
3
|
getMediaBackgroundProps
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7BGAU6C3.js";
|
|
5
5
|
import {
|
|
6
6
|
TemplateText
|
|
7
7
|
} from "./chunk-TCEHK2BW.js";
|
|
8
8
|
import "./chunk-L5BTTCZV.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-FRN6WKHA.js";
|
|
10
10
|
import {
|
|
11
11
|
TOP_TEXT_AREA_RATIO,
|
|
12
12
|
withOpacity
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
interpolate,
|
|
17
17
|
spring
|
|
18
18
|
} from "./chunk-XTOXFMLM.js";
|
|
19
|
-
import "./chunk-C6WVCZRW.js";
|
|
20
19
|
import {
|
|
21
20
|
hasSceneMedia
|
|
22
21
|
} from "./chunk-224QNWRA.js";
|
|
22
|
+
import "./chunk-5CDAM24P.js";
|
|
23
23
|
import {
|
|
24
24
|
resolveTokens
|
|
25
25
|
} from "./chunk-XWWLKRNU.js";
|
|
@@ -8,12 +8,12 @@ import "./chunk-QAAO7OAY.js";
|
|
|
8
8
|
import {
|
|
9
9
|
SceneBackground,
|
|
10
10
|
getMediaBackgroundProps
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7BGAU6C3.js";
|
|
12
12
|
import {
|
|
13
13
|
TemplateText
|
|
14
14
|
} from "./chunk-TCEHK2BW.js";
|
|
15
15
|
import "./chunk-L5BTTCZV.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-FRN6WKHA.js";
|
|
17
17
|
import {
|
|
18
18
|
TOP_TEXT_AREA_RATIO,
|
|
19
19
|
withOpacity
|
|
@@ -22,10 +22,10 @@ import {
|
|
|
22
22
|
interpolate,
|
|
23
23
|
spring
|
|
24
24
|
} from "./chunk-XTOXFMLM.js";
|
|
25
|
-
import "./chunk-C6WVCZRW.js";
|
|
26
25
|
import {
|
|
27
26
|
hasSceneMedia
|
|
28
27
|
} from "./chunk-224QNWRA.js";
|
|
28
|
+
import "./chunk-5CDAM24P.js";
|
|
29
29
|
import {
|
|
30
30
|
MEDIA_TEXT_SHADOW,
|
|
31
31
|
TOKEN_DEFAULTS,
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
SceneBackground,
|
|
7
7
|
getMediaBackgroundProps
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7BGAU6C3.js";
|
|
9
9
|
import {
|
|
10
10
|
TemplateText
|
|
11
11
|
} from "./chunk-TCEHK2BW.js";
|
|
12
12
|
import "./chunk-L5BTTCZV.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-FRN6WKHA.js";
|
|
14
14
|
import {
|
|
15
15
|
TOP_TEXT_AREA_RATIO,
|
|
16
16
|
withOpacity
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
interpolate
|
|
20
20
|
} from "./chunk-XTOXFMLM.js";
|
|
21
|
-
import "./chunk-C6WVCZRW.js";
|
|
22
21
|
import {
|
|
23
22
|
hasSceneMedia
|
|
24
23
|
} from "./chunk-224QNWRA.js";
|
|
24
|
+
import "./chunk-5CDAM24P.js";
|
|
25
25
|
import {
|
|
26
26
|
TOKEN_DEFAULTS,
|
|
27
27
|
resolveTokens
|
package/dist/check-runtime.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// src/visual-system/scene-templates/external-video-backdrop.tsx
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var DEFAULT = { mode: false, audioMuted: true, audioVolume: 1 };
|
|
5
|
+
var sharedContext = globalThis;
|
|
6
|
+
var BackdropContext = sharedContext.__vanillaskyVideoBackdropContext ??= React.createContext(DEFAULT);
|
|
7
|
+
function ExternalVideoBackdropProvider({
|
|
8
|
+
mode,
|
|
9
|
+
audioMuted = true,
|
|
10
|
+
audioVolume = 1,
|
|
11
|
+
children
|
|
12
|
+
}) {
|
|
13
|
+
const value = React.useMemo(
|
|
14
|
+
() => ({ mode, audioMuted, audioVolume }),
|
|
15
|
+
[mode, audioMuted, audioVolume]
|
|
16
|
+
);
|
|
17
|
+
return /* @__PURE__ */ jsx(BackdropContext.Provider, { value, children });
|
|
18
|
+
}
|
|
19
|
+
function useExternalVideoBackdrop() {
|
|
20
|
+
return React.useContext(BackdropContext).mode;
|
|
21
|
+
}
|
|
22
|
+
function useMediaAudio() {
|
|
23
|
+
const { audioMuted, audioVolume } = React.useContext(BackdropContext);
|
|
24
|
+
return { muted: audioMuted, volume: audioVolume };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
ExternalVideoBackdropProvider,
|
|
29
|
+
useExternalVideoBackdrop,
|
|
30
|
+
useMediaAudio
|
|
31
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SceneVideoBackdrop,
|
|
3
3
|
resolveMediaPosition
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FRN6WKHA.js";
|
|
5
5
|
import {
|
|
6
6
|
BrandGradientOverlay,
|
|
7
7
|
getBackgroundTransform
|
|
8
8
|
} from "./chunk-W3VDIBGR.js";
|
|
9
|
-
import {
|
|
10
|
-
useExternalVideoBackdrop
|
|
11
|
-
} from "./chunk-C6WVCZRW.js";
|
|
12
9
|
import {
|
|
13
10
|
resolveMediaType
|
|
14
11
|
} from "./chunk-224QNWRA.js";
|
|
12
|
+
import {
|
|
13
|
+
useExternalVideoBackdrop
|
|
14
|
+
} from "./chunk-5CDAM24P.js";
|
|
15
15
|
|
|
16
16
|
// src/visual-system/scene-templates/scene-background.tsx
|
|
17
17
|
import { useEffect, useState } from "react";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getBackgroundTransform
|
|
3
3
|
} from "./chunk-W3VDIBGR.js";
|
|
4
|
+
import {
|
|
5
|
+
useMediaAudio
|
|
6
|
+
} from "./chunk-5CDAM24P.js";
|
|
4
7
|
|
|
5
8
|
// src/visual-system/scene-templates/scene-video-backdrop.tsx
|
|
6
9
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -27,6 +30,8 @@ var SceneVideoBackdrop = ({
|
|
|
27
30
|
progress,
|
|
28
31
|
beatIntensity = 0,
|
|
29
32
|
isPlaying,
|
|
33
|
+
muted,
|
|
34
|
+
volume,
|
|
30
35
|
playbackId = mediaUrl,
|
|
31
36
|
retainPoster = false,
|
|
32
37
|
persistent = false,
|
|
@@ -34,6 +39,9 @@ var SceneVideoBackdrop = ({
|
|
|
34
39
|
onReady,
|
|
35
40
|
onError
|
|
36
41
|
}) => {
|
|
42
|
+
const inheritedAudio = useMediaAudio();
|
|
43
|
+
const resolvedMuted = muted ?? inheritedAudio.muted;
|
|
44
|
+
const resolvedVolume = volume ?? inheritedAudio.volume;
|
|
37
45
|
const resolvedPosition = resolveMediaPosition(mediaPosition);
|
|
38
46
|
const bgTransform = getBackgroundTransform(backgroundEffect, progress, beatIntensity);
|
|
39
47
|
const [decodedVideoUrl, setDecodedVideoUrl] = useState();
|
|
@@ -41,6 +49,25 @@ var SceneVideoBackdrop = ({
|
|
|
41
49
|
const startedVideoUrl = useRef(void 0);
|
|
42
50
|
const startedPlaybackId = useRef(void 0);
|
|
43
51
|
const videoPresentationKey = `${playbackId}\0${mediaUrl}`;
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
const video = videoRef.current;
|
|
54
|
+
if (!video) return;
|
|
55
|
+
if (video.getAttribute("src") !== mediaUrl) {
|
|
56
|
+
video.setAttribute("src", mediaUrl);
|
|
57
|
+
video.load();
|
|
58
|
+
}
|
|
59
|
+
return () => {
|
|
60
|
+
video.pause();
|
|
61
|
+
video.removeAttribute("src");
|
|
62
|
+
video.load();
|
|
63
|
+
startedVideoUrl.current = void 0;
|
|
64
|
+
startedPlaybackId.current = void 0;
|
|
65
|
+
};
|
|
66
|
+
}, [mediaUrl]);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
const video = videoRef.current;
|
|
69
|
+
if (video) video.volume = resolvedVolume;
|
|
70
|
+
}, [resolvedVolume]);
|
|
44
71
|
useEffect(() => {
|
|
45
72
|
const video = videoRef.current;
|
|
46
73
|
if (!video) return;
|
|
@@ -59,15 +86,6 @@ var SceneVideoBackdrop = ({
|
|
|
59
86
|
startedVideoUrl.current = mediaUrl;
|
|
60
87
|
startedPlaybackId.current = playbackId;
|
|
61
88
|
}, [isPlaying, mediaUrl, playbackId]);
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
const video = videoRef.current;
|
|
64
|
-
return () => {
|
|
65
|
-
if (!video) return;
|
|
66
|
-
video.pause();
|
|
67
|
-
video.removeAttribute("src");
|
|
68
|
-
video.load();
|
|
69
|
-
};
|
|
70
|
-
}, []);
|
|
71
89
|
const mediaStyle = {
|
|
72
90
|
position: "absolute",
|
|
73
91
|
inset: 0,
|
|
@@ -135,7 +153,7 @@ var SceneVideoBackdrop = ({
|
|
|
135
153
|
ref: videoRef,
|
|
136
154
|
src: mediaUrl,
|
|
137
155
|
poster: retainPoster || decodedVideoUrl !== mediaUrl ? mediaPoster || void 0 : void 0,
|
|
138
|
-
muted:
|
|
156
|
+
muted: resolvedMuted,
|
|
139
157
|
loop: true,
|
|
140
158
|
playsInline: true,
|
|
141
159
|
preload: "auto",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ExternalVideoBackdropProvider
|
|
3
|
-
} from "./chunk-C6WVCZRW.js";
|
|
4
1
|
import {
|
|
5
2
|
limitsConcurrentVideoDecoders,
|
|
6
3
|
resolveMediaType
|
|
7
4
|
} from "./chunk-224QNWRA.js";
|
|
5
|
+
import {
|
|
6
|
+
ExternalVideoBackdropProvider
|
|
7
|
+
} from "./chunk-5CDAM24P.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveDensity
|
|
10
10
|
} from "./chunk-XWWLKRNU.js";
|
|
@@ -47,7 +47,7 @@ function scaleSafeZone(zone, factor) {
|
|
|
47
47
|
// src/player/video-frame.tsx
|
|
48
48
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
49
49
|
var SCENE_TRANSITION_SECONDS = 0.3;
|
|
50
|
-
var SceneVideoBackdrop = lazy(() => import("./scene-video-backdrop-
|
|
50
|
+
var SceneVideoBackdrop = lazy(() => import("./scene-video-backdrop-XFPX4O3I.js").then((module) => ({ default: module.SceneVideoBackdrop })));
|
|
51
51
|
var MEDIA_PREROLL_SECONDS = 1.2;
|
|
52
52
|
var CONTIGUITY_ULP_FACTOR = 4;
|
|
53
53
|
var subscribeToDecoderPolicy = () => () => {
|
|
@@ -110,6 +110,8 @@ function SceneLayer({
|
|
|
110
110
|
width,
|
|
111
111
|
height,
|
|
112
112
|
playing,
|
|
113
|
+
mediaAudioMuted,
|
|
114
|
+
mediaAudioVolume,
|
|
113
115
|
layer,
|
|
114
116
|
opacity,
|
|
115
117
|
interactive,
|
|
@@ -118,57 +120,65 @@ function SceneLayer({
|
|
|
118
120
|
}) {
|
|
119
121
|
const template = kit.getTemplate(range.scene.templateId);
|
|
120
122
|
const duration = range.end - range.start;
|
|
121
|
-
return /* @__PURE__ */ jsx(
|
|
122
|
-
|
|
123
|
+
return /* @__PURE__ */ jsx(
|
|
124
|
+
ExternalVideoBackdropProvider,
|
|
123
125
|
{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
...interactive ? {} : { inert: "inert" },
|
|
129
|
-
style: {
|
|
130
|
-
position: "absolute",
|
|
131
|
-
inset: 0,
|
|
132
|
-
opacity,
|
|
133
|
-
zIndex,
|
|
134
|
-
pointerEvents: interactive ? "auto" : "none",
|
|
135
|
-
// A changed-media transition can expose an incoming template's true
|
|
136
|
-
// initial frame. Values that would be false placeholders at progress
|
|
137
|
-
// zero opt into this inherited guard.
|
|
138
|
-
"--vanillasky-transition-semantic-visibility": layer === "incoming" ? "hidden" : "visible",
|
|
139
|
-
"--vanillasky-template-surface": externalVideoBackdrop !== false ? "transparent" : void 0
|
|
140
|
-
},
|
|
141
|
-
children: template ? /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(
|
|
126
|
+
mode: externalVideoBackdrop,
|
|
127
|
+
audioMuted: mediaAudioMuted || !playing,
|
|
128
|
+
audioVolume: mediaAudioVolume,
|
|
129
|
+
children: /* @__PURE__ */ jsx(
|
|
142
130
|
"div",
|
|
143
131
|
{
|
|
144
|
-
"data-
|
|
145
|
-
|
|
132
|
+
"data-scene-layer": layer,
|
|
133
|
+
"data-layer-scene-id": range.scene.id,
|
|
134
|
+
"data-layer-template-id": range.scene.templateId,
|
|
135
|
+
"aria-hidden": interactive ? void 0 : true,
|
|
136
|
+
...interactive ? {} : { inert: "inert" },
|
|
137
|
+
style: {
|
|
138
|
+
position: "absolute",
|
|
139
|
+
inset: 0,
|
|
140
|
+
opacity,
|
|
141
|
+
zIndex,
|
|
142
|
+
pointerEvents: interactive ? "auto" : "none",
|
|
143
|
+
// A changed-media transition can expose an incoming template's true
|
|
144
|
+
// initial frame. Values that would be false placeholders at progress
|
|
145
|
+
// zero opt into this inherited guard.
|
|
146
|
+
"--vanillasky-transition-semantic-visibility": layer === "incoming" ? "hidden" : "visible",
|
|
147
|
+
"--vanillasky-template-surface": externalVideoBackdrop !== false ? "transparent" : void 0
|
|
148
|
+
},
|
|
149
|
+
children: template ? /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(
|
|
150
|
+
"div",
|
|
151
|
+
{
|
|
152
|
+
"data-template-loading": range.scene.templateId,
|
|
153
|
+
style: { position: "absolute", inset: 0 }
|
|
154
|
+
}
|
|
155
|
+
), children: createElement(template.component, {
|
|
156
|
+
variables: {
|
|
157
|
+
...template.defaults ?? getTemplateDefaults(template.schema),
|
|
158
|
+
...range.scene.variables
|
|
159
|
+
},
|
|
160
|
+
style: config.style,
|
|
161
|
+
progress,
|
|
162
|
+
motionProgress,
|
|
163
|
+
beatIntensity: 0,
|
|
164
|
+
width,
|
|
165
|
+
height,
|
|
166
|
+
textArchetype: range.scene.textArchetype ?? config.style.defaultTextArchetype,
|
|
167
|
+
backgroundEffect: range.scene.backgroundEffect ?? config.style.defaultBackgroundEffect,
|
|
168
|
+
safeZone: scaleSafeZone(
|
|
169
|
+
getSafeZone(config.orientation),
|
|
170
|
+
resolveDensity(config.style.density).safeZoneScale
|
|
171
|
+
),
|
|
172
|
+
sceneDuration: duration,
|
|
173
|
+
isPlaying: playing
|
|
174
|
+
}) }) : /* @__PURE__ */ jsxs("div", { style: { width, height, background: "#090712", color: "#fff" }, children: [
|
|
175
|
+
"Unsupported template: ",
|
|
176
|
+
range.scene.templateId
|
|
177
|
+
] })
|
|
146
178
|
}
|
|
147
|
-
)
|
|
148
|
-
variables: {
|
|
149
|
-
...template.defaults ?? getTemplateDefaults(template.schema),
|
|
150
|
-
...range.scene.variables
|
|
151
|
-
},
|
|
152
|
-
style: config.style,
|
|
153
|
-
progress,
|
|
154
|
-
motionProgress,
|
|
155
|
-
beatIntensity: 0,
|
|
156
|
-
width,
|
|
157
|
-
height,
|
|
158
|
-
textArchetype: range.scene.textArchetype ?? config.style.defaultTextArchetype,
|
|
159
|
-
backgroundEffect: range.scene.backgroundEffect ?? config.style.defaultBackgroundEffect,
|
|
160
|
-
safeZone: scaleSafeZone(
|
|
161
|
-
getSafeZone(config.orientation),
|
|
162
|
-
resolveDensity(config.style.density).safeZoneScale
|
|
163
|
-
),
|
|
164
|
-
sceneDuration: duration,
|
|
165
|
-
isPlaying: playing
|
|
166
|
-
}) }) : /* @__PURE__ */ jsxs("div", { style: { width, height, background: "#090712", color: "#fff" }, children: [
|
|
167
|
-
"Unsupported template: ",
|
|
168
|
-
range.scene.templateId
|
|
169
|
-
] })
|
|
179
|
+
)
|
|
170
180
|
}
|
|
171
|
-
)
|
|
181
|
+
);
|
|
172
182
|
}
|
|
173
183
|
function VideoFrame({
|
|
174
184
|
kit,
|
|
@@ -177,6 +187,8 @@ function VideoFrame({
|
|
|
177
187
|
width,
|
|
178
188
|
height,
|
|
179
189
|
playing = false,
|
|
190
|
+
mediaAudioMuted = true,
|
|
191
|
+
mediaAudioVolume = 1,
|
|
180
192
|
className,
|
|
181
193
|
style
|
|
182
194
|
}) {
|
|
@@ -351,6 +363,8 @@ function VideoFrame({
|
|
|
351
363
|
backgroundEffect: persistentVideoRange.scene.backgroundEffect ?? config.style.defaultBackgroundEffect,
|
|
352
364
|
progress: persistentVideoRange.scene.id === active.scene.id ? rawProgress : 0,
|
|
353
365
|
isPlaying: persistentVideoRange.scene.id === active.scene.id && playing,
|
|
366
|
+
muted: mediaAudioMuted || persistentVideoRange.scene.id !== active.scene.id || !playing,
|
|
367
|
+
volume: mediaAudioVolume,
|
|
354
368
|
playbackId: persistentVideoRange.scene.id,
|
|
355
369
|
retainPoster: true,
|
|
356
370
|
persistent: true,
|
|
@@ -380,6 +394,8 @@ function VideoFrame({
|
|
|
380
394
|
width: canvas.width,
|
|
381
395
|
height: canvas.height,
|
|
382
396
|
playing,
|
|
397
|
+
mediaAudioMuted,
|
|
398
|
+
mediaAudioVolume,
|
|
383
399
|
layer: previewingNext ? "outgoing" : "active",
|
|
384
400
|
opacity: 1 - blendProgress,
|
|
385
401
|
interactive: true,
|
|
@@ -399,6 +415,8 @@ function VideoFrame({
|
|
|
399
415
|
width: canvas.width,
|
|
400
416
|
height: canvas.height,
|
|
401
417
|
playing: false,
|
|
418
|
+
mediaAudioMuted,
|
|
419
|
+
mediaAudioVolume,
|
|
402
420
|
layer: "incoming",
|
|
403
421
|
opacity: blendProgress,
|
|
404
422
|
interactive: false,
|
|
@@ -419,6 +437,8 @@ function VideoFrame({
|
|
|
419
437
|
width: canvas.width,
|
|
420
438
|
height: canvas.height,
|
|
421
439
|
playing,
|
|
440
|
+
mediaAudioMuted,
|
|
441
|
+
mediaAudioVolume,
|
|
422
442
|
layer: "active",
|
|
423
443
|
opacity: 1,
|
|
424
444
|
interactive: true,
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
SceneBackground,
|
|
6
6
|
getMediaBackgroundProps
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-7BGAU6C3.js";
|
|
8
|
+
import "./chunk-FRN6WKHA.js";
|
|
9
9
|
import "./chunk-W3VDIBGR.js";
|
|
10
10
|
import {
|
|
11
11
|
SPRING_SMOOTH,
|
|
12
12
|
interpolate,
|
|
13
13
|
spring
|
|
14
14
|
} from "./chunk-XTOXFMLM.js";
|
|
15
|
-
import "./chunk-C6WVCZRW.js";
|
|
16
15
|
import "./chunk-224QNWRA.js";
|
|
16
|
+
import "./chunk-5CDAM24P.js";
|
|
17
17
|
import {
|
|
18
18
|
TOKEN_DEFAULTS,
|
|
19
19
|
resolveTokens
|
|
@@ -5,22 +5,22 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
SceneBackground,
|
|
7
7
|
getMediaBackgroundProps
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7BGAU6C3.js";
|
|
9
9
|
import {
|
|
10
10
|
TemplateText
|
|
11
11
|
} from "./chunk-TCEHK2BW.js";
|
|
12
12
|
import "./chunk-L5BTTCZV.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-FRN6WKHA.js";
|
|
14
14
|
import "./chunk-W3VDIBGR.js";
|
|
15
15
|
import {
|
|
16
16
|
SPRING_SMOOTH,
|
|
17
17
|
interpolate,
|
|
18
18
|
spring
|
|
19
19
|
} from "./chunk-XTOXFMLM.js";
|
|
20
|
-
import "./chunk-C6WVCZRW.js";
|
|
21
20
|
import {
|
|
22
21
|
hasSceneMedia
|
|
23
22
|
} from "./chunk-224QNWRA.js";
|
|
23
|
+
import "./chunk-5CDAM24P.js";
|
|
24
24
|
import {
|
|
25
25
|
TOKEN_DEFAULTS,
|
|
26
26
|
resolveTokens
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
SceneBackground,
|
|
7
7
|
getMediaBackgroundProps
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-7BGAU6C3.js";
|
|
9
|
+
import "./chunk-FRN6WKHA.js";
|
|
10
10
|
import "./chunk-W3VDIBGR.js";
|
|
11
11
|
import {
|
|
12
12
|
SPRING_BOUNCY,
|
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
interpolate,
|
|
15
15
|
spring
|
|
16
16
|
} from "./chunk-XTOXFMLM.js";
|
|
17
|
-
import "./chunk-C6WVCZRW.js";
|
|
18
17
|
import "./chunk-224QNWRA.js";
|
|
18
|
+
import "./chunk-5CDAM24P.js";
|
|
19
19
|
import {
|
|
20
20
|
resolveTokens
|
|
21
21
|
} from "./chunk-XWWLKRNU.js";
|
|
@@ -7,23 +7,23 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
SceneBackground,
|
|
9
9
|
getMediaBackgroundProps
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7BGAU6C3.js";
|
|
11
11
|
import {
|
|
12
12
|
TemplateText
|
|
13
13
|
} from "./chunk-TCEHK2BW.js";
|
|
14
14
|
import {
|
|
15
15
|
Emoji
|
|
16
16
|
} from "./chunk-L5BTTCZV.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-FRN6WKHA.js";
|
|
18
18
|
import "./chunk-W3VDIBGR.js";
|
|
19
19
|
import {
|
|
20
20
|
interpolate,
|
|
21
21
|
spring
|
|
22
22
|
} from "./chunk-XTOXFMLM.js";
|
|
23
|
-
import "./chunk-C6WVCZRW.js";
|
|
24
23
|
import {
|
|
25
24
|
hasSceneMedia
|
|
26
25
|
} from "./chunk-224QNWRA.js";
|
|
26
|
+
import "./chunk-5CDAM24P.js";
|
|
27
27
|
import {
|
|
28
28
|
TOKEN_DEFAULTS,
|
|
29
29
|
resolveTokens
|
package/dist/{infographic-problem-solution-IW35S6BR.js → infographic-problem-solution-FMLJCPG6.js}
RENAMED
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
SceneBackground,
|
|
6
6
|
getMediaBackgroundProps
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7BGAU6C3.js";
|
|
8
8
|
import {
|
|
9
9
|
smoothSize
|
|
10
10
|
} from "./chunk-TCEHK2BW.js";
|
|
11
11
|
import "./chunk-L5BTTCZV.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FRN6WKHA.js";
|
|
13
13
|
import "./chunk-W3VDIBGR.js";
|
|
14
14
|
import {
|
|
15
15
|
interpolate,
|
|
16
16
|
spring
|
|
17
17
|
} from "./chunk-XTOXFMLM.js";
|
|
18
|
-
import "./chunk-C6WVCZRW.js";
|
|
19
18
|
import "./chunk-224QNWRA.js";
|
|
19
|
+
import "./chunk-5CDAM24P.js";
|
|
20
20
|
import {
|
|
21
21
|
TOKEN_DEFAULTS,
|
|
22
22
|
resolveTokens
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SceneBackground,
|
|
3
3
|
getMediaBackgroundProps
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7BGAU6C3.js";
|
|
5
5
|
import {
|
|
6
6
|
TemplateText
|
|
7
7
|
} from "./chunk-TCEHK2BW.js";
|
|
8
8
|
import "./chunk-L5BTTCZV.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-FRN6WKHA.js";
|
|
10
10
|
import {
|
|
11
11
|
TOP_TEXT_AREA_RATIO,
|
|
12
12
|
withOpacity
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
interpolate,
|
|
16
16
|
spring
|
|
17
17
|
} from "./chunk-XTOXFMLM.js";
|
|
18
|
-
import "./chunk-C6WVCZRW.js";
|
|
19
18
|
import {
|
|
20
19
|
hasSceneMedia
|
|
21
20
|
} from "./chunk-224QNWRA.js";
|
|
21
|
+
import "./chunk-5CDAM24P.js";
|
|
22
22
|
import {
|
|
23
23
|
TOKEN_DEFAULTS,
|
|
24
24
|
resolveTokens
|