Skip to content

Commit 752fffa

Browse files
committed
Update dependencies and enhance documentation: Upgrade @diffusionstudio/core-v4 to version 4.0.2, and add required HTTP headers section for proper operation in README and migration guide.
1 parent cb6ae09 commit 752fffa

File tree

6 files changed

+110
-5
lines changed

6 files changed

+110
-5
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ new core.RectangleClip({
117117
})
118118
```
119119

120+
## Required Headers
121+
122+
Diffusion Studio Core requires specific HTTP headers to be set for proper operation. These headers enable the use of SharedArrayBuffer and other advanced browser APIs needed for video processing.
123+
124+
The following headers are required:
125+
- `Cross-Origin-Opener-Policy: same-origin`
126+
- `Cross-Origin-Embedder-Policy: credentialless`
127+
120128
## Pricing
121129

122130
You can use the engine for free as long as you keep the "Made with Diffusion Studio" watermark on the rendered video. To remove the watermark, you can purchase a [license key](https://www.diffusion.studio/core-rendering-engine#pricing).

docs/src/content/index.mdx

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,81 @@ import * as core from '@diffusionstudio/core';
2020

2121
const composition = new core.Composition();
2222
```
23+
24+
## Required Headers
25+
26+
Diffusion Studio Core requires specific HTTP headers to be set for proper operation. These headers enable the use of SharedArrayBuffer and other advanced browser APIs needed for video processing.
27+
28+
The following headers are required:
29+
- `Cross-Origin-Opener-Policy: same-origin`
30+
- `Cross-Origin-Embedder-Policy: credentialless`
31+
32+
### Vite
33+
34+
Add the following to your `vite.config.js`:
35+
36+
```js
37+
export default {
38+
server: {
39+
headers: {
40+
'Cross-Origin-Opener-Policy': 'same-origin',
41+
'Cross-Origin-Embedder-Policy': 'credentialless',
42+
}
43+
},
44+
}
45+
```
46+
47+
### Next.js
48+
49+
For Next.js, add the headers in your `next.config.js`:
50+
51+
```js
52+
/** @type {import('next').NextConfig} */
53+
const nextConfig = {
54+
async headers() {
55+
return [
56+
{
57+
source: '/:path*',
58+
headers: [
59+
{
60+
key: 'Cross-Origin-Opener-Policy',
61+
value: 'same-origin',
62+
},
63+
{
64+
key: 'Cross-Origin-Embedder-Policy',
65+
value: 'credentialless',
66+
},
67+
],
68+
},
69+
];
70+
},
71+
};
72+
73+
module.exports = nextConfig;
74+
```
75+
76+
### Express/Node.js
77+
78+
For a custom Express server:
79+
80+
```js
81+
const express = require('express');
82+
const app = express();
83+
84+
app.use((req, res, next) => {
85+
res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
86+
res.setHeader('Cross-Origin-Embedder-Policy', 'credentialless');
87+
next();
88+
});
89+
90+
// ... rest of your app
91+
```
92+
93+
### Production Deployment
94+
95+
For production deployments, ensure your hosting provider or reverse proxy (nginx, Apache, etc.) sets these headers. For example, with nginx:
96+
97+
```nginx
98+
add_header Cross-Origin-Opener-Policy "same-origin" always;
99+
add_header Cross-Origin-Embedder-Policy "credentialless" always;
100+
```

docs/src/content/v3-v4.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This guide will help you migrate your code from Diffusion Studio Core v3 to v4.
44

55
## Table of Contents
66

7+
- [Required Headers](#required-headers)
78
- [Composition Changes](#composition-changes)
89
- [Layer Management](#layer-management)
910
- [Clip API Changes](#clip-api-changes)
@@ -17,6 +18,16 @@ This guide will help you migrate your code from Diffusion Studio Core v3 to v4.
1718
- [Keyframe Animations](#keyframe-animations)
1819
- [Text Clip Properties](#text-clip-properties)
1920

21+
## Required Headers
22+
23+
> **Important:** v4 requires specific HTTP headers to be configured for proper operation. These headers enable SharedArrayBuffer and other advanced browser APIs needed for video processing.
24+
25+
You must configure your development server and production environment to set these headers:
26+
- `Cross-Origin-Opener-Policy: same-origin`
27+
- `Cross-Origin-Embedder-Policy: credentialless`
28+
29+
For more examples and production deployment configurations, see the [Required Headers section](/docs) in the main documentation.
30+
2031
## Composition Changes
2132

2233
### License Key

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
"vite": "^7.2.2"
1616
},
1717
"dependencies": {
18-
"@diffusionstudio/core-v4": "^4.0.1"
18+
"@diffusionstudio/core": "^4.0.0"
1919
}
2020
}

vite.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default {
2+
server: {
3+
headers: {
4+
'Cross-Origin-Opener-Policy': 'same-origin',
5+
'Cross-Origin-Embedder-Policy': 'credentialless',
6+
}
7+
},
8+
}

0 commit comments

Comments
 (0)