我想设置标题
Cross-Origin-Embedder-Policy: require-corp
,Cross-Origin-Opener-Policy: same-origin
所以我可以启用SharedArrayBuffer
,所以我可以使用https://github.com/ffmpegwasm/ffmpeg.wasm
我已经设置了这些firebase.json
,但是console.log(crossOriginIsolated)
产量false
,以及任何使用 FFmpeg 错误的尝试SharedArrayBuffer is not defined
。模拟器和部署的站点都会发生这种情况。
我正在ffmpegwasm
从 jsdeliver加载<script src="https://cdn.jsdelivr.net/npm/@ffmpeg/ffmpeg@0.10.1/dist/ffmpeg.min.js" crossorigin="true"></script>
这是我的完整firebase.json
(只是一个简单的演示项目),底部有标题:
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"emulators": {
"functions": {
"port": 5001
},
"hosting": {
"port": 5000
},
"ui": {
"enabled": true
}
},
"headers": [
{
"source": "**",
"headers": [
{
"key": "Cross-Origin-Embedder-Policy",
"value": "require-corp"
},
{
"key": "Cross-Origin-Opener-Policy",
"value": "same-origin"
}
]
}
]
}
我究竟做错了什么?谢谢!