@qooal/vault 0.1.0 → 0.1.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/CHANGELOG.md +11 -0
- package/dist/react.js +23 -6
- package/dist/types/react/index.d.ts +1 -1
- package/dist/types/react/props.d.ts +11 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.1 - 2026-12-06
|
|
4
|
+
|
|
5
|
+
Fix: video posters match what the Vault edge serves.
|
|
6
|
+
|
|
7
|
+
- `vaultVideoSources` (and so `VaultVideo`) builds the poster as the stored JPEG at `.jpg`, with no transformation.
|
|
8
|
+
0.1.0 added `c_limit,w_1280` by default, which the edge ignores.
|
|
9
|
+
- `posterFormat` is deprecated and its type is now `"jpg" | "jpeg"`: the edge answers 404 for a `png`, `webp` or
|
|
10
|
+
`avif` poster. Any other value falls back to `jpg`, with a one-time warning in development.
|
|
11
|
+
- `posterTransformation` is deprecated and ignored (the edge ignores poster transformations), with a one-time warning
|
|
12
|
+
in development.
|
|
13
|
+
|
|
3
14
|
## 0.1.0 - 2026-12-06
|
|
4
15
|
|
|
5
16
|
First public release on npm.
|
package/dist/react.js
CHANGED
|
@@ -58,17 +58,34 @@ function vaultImageProps(o) {
|
|
|
58
58
|
if (o.height !== void 0) out.height = o.height;
|
|
59
59
|
return out;
|
|
60
60
|
}
|
|
61
|
+
var warned = /* @__PURE__ */ new Set();
|
|
62
|
+
function isDevelopment() {
|
|
63
|
+
try {
|
|
64
|
+
return process.env.NODE_ENV !== "production";
|
|
65
|
+
} catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function warnOnce(message) {
|
|
70
|
+
if (warned.has(message) || !isDevelopment()) return;
|
|
71
|
+
warned.add(message);
|
|
72
|
+
console.warn(message);
|
|
73
|
+
}
|
|
61
74
|
function vaultVideoSources(o) {
|
|
62
75
|
const v = o.version !== void 0 ? { version: o.version } : {};
|
|
76
|
+
const format = o.posterFormat;
|
|
77
|
+
if (format !== void 0 && format !== "jpg" && format !== "jpeg")
|
|
78
|
+
warnOnce(
|
|
79
|
+
`@qooal/vault: posterFormat ${JSON.stringify(format)} is not served (posters are always JPEG); using "jpg". posterFormat is deprecated.`
|
|
80
|
+
);
|
|
81
|
+
if (o.posterTransformation !== void 0 && o.posterTransformation !== "")
|
|
82
|
+
warnOnce(
|
|
83
|
+
"@qooal/vault: posterTransformation is ignored (the edge serves the stored JPEG poster as is). posterTransformation is deprecated."
|
|
84
|
+
);
|
|
63
85
|
return {
|
|
64
86
|
hls: vaultUrl(o.library, o.publicId, { resourceType: "video", format: "m3u8", ...v }),
|
|
65
87
|
mp4: vaultUrl(o.library, o.publicId, { resourceType: "video", format: "mp4", ...v }),
|
|
66
|
-
poster: vaultUrl(o.library, o.publicId, {
|
|
67
|
-
resourceType: "video",
|
|
68
|
-
format: o.posterFormat ?? "jpg",
|
|
69
|
-
transformation: o.posterTransformation ?? "c_limit,w_1280",
|
|
70
|
-
...v
|
|
71
|
-
})
|
|
88
|
+
poster: vaultUrl(o.library, o.publicId, { resourceType: "video", format: "jpg", ...v })
|
|
72
89
|
};
|
|
73
90
|
}
|
|
74
91
|
|
|
@@ -44,7 +44,7 @@ export type VaultVideoProps = Omit<VideoHTMLAttributes<HTMLVideoElement>, "src"
|
|
|
44
44
|
library: VaultUrlLibrary;
|
|
45
45
|
publicId: string;
|
|
46
46
|
version?: number;
|
|
47
|
-
/** the poster URL; default the Vault poster; `false` for none */
|
|
47
|
+
/** the poster URL; default the Vault poster (the stored JPEG); `false` for none */
|
|
48
48
|
poster?: string | false;
|
|
49
49
|
/** a signed HLS master URL for `authenticated` videos (mint it on your server); default the public one */
|
|
50
50
|
src?: string;
|
|
@@ -39,18 +39,24 @@ export interface VaultVideoOptions {
|
|
|
39
39
|
library: VaultUrlLibrary;
|
|
40
40
|
publicId: string;
|
|
41
41
|
version?: number;
|
|
42
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated Ignored. The edge serves a video's poster as the stored JPEG and ignores poster transformations, so
|
|
44
|
+
* the poster URL carries none.
|
|
45
|
+
*/
|
|
43
46
|
posterTransformation?: string;
|
|
44
|
-
/**
|
|
45
|
-
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated The poster is always the stored JPEG (`.jpg`); the edge answers 404 for any other poster format. Any
|
|
49
|
+
* other value is replaced by `jpg` (with a warning in development).
|
|
50
|
+
*/
|
|
51
|
+
posterFormat?: "jpg" | "jpeg";
|
|
46
52
|
}
|
|
47
53
|
export interface VaultVideoSources {
|
|
48
54
|
/** the HLS master playlist on the video host */
|
|
49
55
|
hls: string;
|
|
50
56
|
/** the 720p MP4 fallback */
|
|
51
57
|
mp4: string;
|
|
52
|
-
/** the poster on the media host */
|
|
58
|
+
/** the poster (the stored JPEG) on the media host */
|
|
53
59
|
poster: string;
|
|
54
60
|
}
|
|
55
|
-
/** The URLs of a public Vault video. */
|
|
61
|
+
/** The URLs of a public Vault video. The poster is always the stored JPEG (`.jpg`), with no transformation. */
|
|
56
62
|
export declare function vaultVideoSources(o: VaultVideoOptions): VaultVideoSources;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qooal/vault",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "The JavaScript SDK for Qooal Vault: delivery URLs with image transformations, signed URLs, browser uploads, an upload widget, React components, a Next.js image loader and server helpers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://qooal.com/docs/vault",
|