audio-cutter
audio-cutter copied to clipboard
Instead of selecting or dragging a file, can i set a file from an URL file?
I want to have a web page with a preloaded file from an URL. Thanks.
No because if you load file from an URL, you might get CORS issues.
But if it is loaded from an URL of the same domain?
@softmaniaperu
What is the way you want to read the URL?
- From a URL query like this:
https://meowtec.github.io/audio-cutter/dist/?audio=https://host/path.mp3
? - Or read from a text box such as
window.prompt()
?
If CORS is not a problem, both are easy to implement. All that needs to be done is adding a componentDidMount
lifecycle in src/index.tsx
, and fetch
the audio URL to a blob, then call handleFileChang(blob)
. (We should modify File
to Blob
on some places).
If you can code, PR welcome.