From 94f3c6ad80c9492860b9e6bb2e5e574a4b30d0d0 Mon Sep 17 00:00:00 2001 From: Alf Date: Tue, 27 Jul 2021 20:22:36 -0700 Subject: [PATCH] Switch to Netlify static host to support SharedArrayBuffer via COEP/COOP headers. Github Pages does not support these headers yet. --- README.md | 8 ++++---- www/public/netlify.toml | 5 +++++ www/src/App.vue | 5 ----- www/src/components/File.vue | 1 + www/vue.config.js | 3 --- 5 files changed, 10 insertions(+), 12 deletions(-) create mode 100644 www/public/netlify.toml diff --git a/README.md b/README.md index a0698b5..3e70707 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ # `FFProbe Wasm` > A Web-based FFProbe. Powered by FFmpeg, Vue and Web Assembly! -https://alfg.github.io/ffprobe-wasm/ - -⚠️ ️Compatible with Chrome and Edge only due to limited support for [SharedArrayBuffer](https://caniuse.com/sharedarraybuffer) and the [required CORS headers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) for Firefox on Github Pages. +https://ffprobe-wasm.netlify.app/ ## Development `ffprobe-wasm` uses [emscripten](https://emscripten.org/) to compile [FFmpeg](https://ffmpeg.org)'s [libav](https://ffmpeg.org/doxygen/4.1/index.html) to [Web Assembly](https://webassembly.org/) via [Docker](https://www.docker.com/). @@ -42,7 +40,9 @@ npm run build ``` ### Deploy -Deploys to [Github Pages](https://pages.github.com/) +Builds and deploys to `gh-pages` branch. + +However, I am hosting on [Netlify](https://netlify.com) to enable [SharedArrayBuffer](https://caniuse.com/sharedarraybuffer) support via the [required CORS headers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer). ``` npm run deploy ``` diff --git a/www/public/netlify.toml b/www/public/netlify.toml new file mode 100644 index 0000000..374c23f --- /dev/null +++ b/www/public/netlify.toml @@ -0,0 +1,5 @@ +[[headers]] + for = "/*" + [headers.values] + Cross-Origin-Embedder-Policy = "require-corp" + Cross-Origin-Opener-Policy = "same-origin" \ No newline at end of file diff --git a/www/src/App.vue b/www/src/App.vue index 34292fb..d178735 100644 --- a/www/src/App.vue +++ b/www/src/App.vue @@ -13,11 +13,6 @@
- - Please use Google Chrome or Microsoft Edge. - - -
diff --git a/www/src/components/File.vue b/www/src/components/File.vue index 6dddd94..fc95920 100644 --- a/www/src/components/File.vue +++ b/www/src/components/File.vue @@ -86,6 +86,7 @@ export default { ], examples: [ { name: 'Video Counter (10min, unfragmented, AVC Baseline)', value: 'https://video-examples-public.s3.us-west-2.amazonaws.com/video_counter_10min_unfragmented_avc.mp4' }, + { name: 'Tears of Steel 360p (00:12:14, unfragmented, AVC Baseline, 67.85 MB)', value: 'https://video-examples-public.s3.us-west-2.amazonaws.com/tears-of-steel-360p.mp4' }, ], protocol: 'file', file: null, diff --git a/www/vue.config.js b/www/vue.config.js index a64b2f5..cc12c15 100644 --- a/www/vue.config.js +++ b/www/vue.config.js @@ -5,9 +5,6 @@ module.exports = { title: 'FFProbe', } }, - publicPath: process.env.NODE_ENV === 'production' - ? '/ffprobe-wasm/' - : '/', configureWebpack: { devServer: { headers: {