bvibber / ogv.js

JavaScript media player using Ogg/Vorbis/Theora/Opus/WebM libs compiled with Emscripten

Home Page:https://brooke.vibber.net/misc/ogv.js/demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to set up appropriate CORS headers to allow loading of the worker JS modules ?

HorbachAndrii opened this issue · comments

Can't download ogv-demuxer-webm-wasm.wasm, but this ogv-demuxer-webm-wasm.js was download

image

How to set up appropriate CORS headers to allow loading of the worker JS modules?
Can you give some example?

Will be great if will be exist a way to manual load the worker JS modules.
like this

<script src="https://some.site/ogv/ogv.js"></script>
<script src="https://some.site/ogv/ogv-demuxer-webm-wasm.js"></script>
<script src="https://some.site/ogv/ogv-demuxer-webm-wasm.wasm"></script>

and etc.

For the CORS issue this is relative to your hosting configuration not the library itself. That mean you need to enable CORS on the OVG and sub dirs in your hosting site.

Note if you want to play a video, this video also needs to be serve via a hosting with CORS enabled (+ from my experience you have to add Content-Range to the allowed cors headers as a response of the server)

Hope this helps, if you want for the library you can use a fallback on a CDN version (CORS enabled by nature) like jsdelivr and have a look to that CodePen for the usage.