@vanillaskyai/video 0.3.3 → 0.3.4
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 +10 -0
- package/README.md +3 -3
- package/dist/check-runtime.js +1 -1
- package/dist/{chunk-HXSV6RHF.js → chunk-N3KUA7VP.js} +14 -2
- package/dist/react.js +1 -1
- package/docs/getting-started.md +2 -2
- package/docs/integrate-nextjs.md +2 -2
- package/examples/nextjs-quickstart/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ VanillaSky follows semantic versioning. This changelog begins with the 0.1 beta.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 0.3.4
|
|
8
|
+
|
|
9
|
+
- Mounts a scene that brings a new photo or video 1.2s before it appears,
|
|
10
|
+
instead of 0.3s, so the element has time to decode and the scene arrives
|
|
11
|
+
showing its picture rather than a gradient that pops a beat later. The extra
|
|
12
|
+
time is invisible: the layer stays fully transparent until the existing
|
|
13
|
+
0.3s cross-fade begins, so every rendered frame is unchanged, and the mounted
|
|
14
|
+
element is handed to the incoming scene rather than rebuilt. Scenes that
|
|
15
|
+
reuse the backdrop already on screen are unaffected.
|
|
16
|
+
|
|
7
17
|
## 0.3.3
|
|
8
18
|
|
|
9
19
|
- Keeps a soundtrack audible on iPhone Safari when its audio context cannot be
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Give your AI a video output
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|
|
|
5
5
|
**VanillaSky is the open-source video response layer.** Turn text, structured
|
|
6
6
|
data, and live application context into personalized video responses that start
|
|
@@ -17,7 +17,7 @@ the planning prompt, trusted templates, validation, streaming, and player.
|
|
|
17
17
|
For humans:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npm install @vanillaskyai/video@0.3.
|
|
20
|
+
npm install @vanillaskyai/video@0.3.4 ai @ai-sdk/openai
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
For coding agents:
|
|
@@ -106,7 +106,7 @@ shows each complete, validated scene as soon as it is ready and returns a
|
|
|
106
106
|
deterministic `Video` object when generation finishes.
|
|
107
107
|
|
|
108
108
|
A copy-and-run app is in
|
|
109
|
-
[`examples/nextjs-quickstart`](https://github.com/VanillaSkyAi/video/tree/v0.3.
|
|
109
|
+
[`examples/nextjs-quickstart`](https://github.com/VanillaSkyAi/video/tree/v0.3.4/examples/nextjs-quickstart).
|
|
110
110
|
|
|
111
111
|
## Shape the response
|
|
112
112
|
|
package/dist/check-runtime.js
CHANGED
|
@@ -31,6 +31,7 @@ function scaleSafeZone(zone, factor) {
|
|
|
31
31
|
// src/player/video-frame.tsx
|
|
32
32
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
33
|
var SCENE_TRANSITION_SECONDS = 0.3;
|
|
34
|
+
var MEDIA_PREROLL_SECONDS = 1.2;
|
|
34
35
|
var CONTIGUITY_ULP_FACTOR = 4;
|
|
35
36
|
function clamp01(value) {
|
|
36
37
|
return Math.max(0, Math.min(1, value));
|
|
@@ -51,6 +52,9 @@ function brandBackgroundFallback(config) {
|
|
|
51
52
|
const background = config.style.brand.background;
|
|
52
53
|
return background.type === "solid" ? background.color : background.colors[0];
|
|
53
54
|
}
|
|
55
|
+
function sceneHasBackdrop(range) {
|
|
56
|
+
return String(range.scene.variables.mediaType || "auto") !== "gradient" && String(range.scene.variables.mediaUrl || "").trim() !== "";
|
|
57
|
+
}
|
|
54
58
|
function sceneBackgroundChanges(left, right) {
|
|
55
59
|
const mediaUrl = (range) => String(range.scene.variables.mediaType || "auto") === "gradient" ? "" : String(range.scene.variables.mediaUrl || "");
|
|
56
60
|
return mediaUrl(left) !== mediaUrl(right);
|
|
@@ -178,6 +182,14 @@ function VideoFrame({
|
|
|
178
182
|
);
|
|
179
183
|
const blendStart = active.end - blendDuration;
|
|
180
184
|
const blendEnd = blendStart + blendDuration;
|
|
185
|
+
const prerollsNext = Boolean(
|
|
186
|
+
contiguousNext && sceneHasBackdrop(contiguousNext) && sceneBackgroundChanges(active, contiguousNext)
|
|
187
|
+
);
|
|
188
|
+
const prerollDuration = prerollsNext ? Math.min(Math.max(MEDIA_PREROLL_SECONDS, blendDuration), Math.max(0, duration)) : blendDuration;
|
|
189
|
+
const prerollStart = active.end - prerollDuration;
|
|
190
|
+
const mountingNext = Boolean(
|
|
191
|
+
contiguousNext && time >= prerollStart && time < blendEnd && (eligibleNextTransition || prerollsNext)
|
|
192
|
+
);
|
|
181
193
|
const previewingNext = Boolean(
|
|
182
194
|
eligibleNextTransition && time >= blendStart && time < blendEnd
|
|
183
195
|
);
|
|
@@ -232,7 +244,7 @@ function VideoFrame({
|
|
|
232
244
|
}
|
|
233
245
|
}
|
|
234
246
|
),
|
|
235
|
-
|
|
247
|
+
mountingNext && contiguousNext ? [
|
|
236
248
|
/* @__PURE__ */ jsx(
|
|
237
249
|
SceneLayer,
|
|
238
250
|
{
|
|
@@ -244,7 +256,7 @@ function VideoFrame({
|
|
|
244
256
|
width: canvas.width,
|
|
245
257
|
height: canvas.height,
|
|
246
258
|
playing,
|
|
247
|
-
layer: "outgoing",
|
|
259
|
+
layer: previewingNext ? "outgoing" : "active",
|
|
248
260
|
opacity: 1 - blendProgress,
|
|
249
261
|
interactive: true,
|
|
250
262
|
zIndex: 1
|
package/dist/react.js
CHANGED
package/docs/getting-started.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Install VanillaSky:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @vanillaskyai/video@0.3.
|
|
8
|
+
npm install @vanillaskyai/video@0.3.4 ai @ai-sdk/openai
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Set your provider key in `.env.local` (never commit it):
|
|
@@ -50,7 +50,7 @@ sets its marker only for `next dev`, and it accepts only localhost. Every
|
|
|
50
50
|
production request is denied. Replace it with your real session validation
|
|
51
51
|
before deploying. For literal files and commands,
|
|
52
52
|
use the tested
|
|
53
|
-
[`examples/nextjs-quickstart` directory](https://github.com/VanillaSkyAi/video/tree/v0.3.
|
|
53
|
+
[`examples/nextjs-quickstart` directory](https://github.com/VanillaSkyAi/video/tree/v0.3.4/examples/nextjs-quickstart).
|
|
54
54
|
|
|
55
55
|
`model` can come from any AI SDK provider, registry, gateway, compatible API,
|
|
56
56
|
or custom implementation. The application can choose a cheaper or faster model
|
package/docs/integrate-nextjs.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Install VanillaSky and one AI SDK provider:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @vanillaskyai/video@0.3.
|
|
8
|
+
npm install @vanillaskyai/video@0.3.4 ai @ai-sdk/openai
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Create an ignored `.env.local`:
|
|
@@ -74,7 +74,7 @@ requests; replace it with your application's session validation before
|
|
|
74
74
|
deploying.
|
|
75
75
|
|
|
76
76
|
The copy-and-run app is in the
|
|
77
|
-
[`examples/nextjs-quickstart` directory](https://github.com/VanillaSkyAi/video/tree/v0.3.
|
|
77
|
+
[`examples/nextjs-quickstart` directory](https://github.com/VanillaSkyAi/video/tree/v0.3.4/examples/nextjs-quickstart).
|
|
78
78
|
|
|
79
79
|
For another LLM, replace `openai(...)` with the matching AI SDK model. The route
|
|
80
80
|
shape and React code stay the same. See [Provider integration](provider-integration.md)
|