Allow controller to be passed as parameter#1
Allow controller to be passed as parameter#1duartencarvalho wants to merge 3 commits intoTouffy:masterfrom
Conversation
…ed from the outside
|
Hi Duarte. I think it would be more in line with existing APIs ( Also… I don't mean to pry, but I'm curious about what use-case you may have for this feature ? |
|
Hello! I understand your point, but how can you abort the here
I allow users to export big media projects, and they have to be able to cancel the download if they need to. Was there a way of doing this without changing the module? :) |
|
If the user is downloading from a stream, usually they can use their browser's UI to cancel the download and that will implicitly call cancel on the DownloadStream and abort its But if you really need the external abort, the way to do it is to listen for the abort event on the external signal and react by calling externalSignal.addEventListener("abort", function (e) { controller.abort(this.reason) })It may take a little more code if you want to take into account the possibility that the external signal is already aborted when the DownloadStream starts. Again, that may seem like a weird thing to happen, but |
No description provided.