Open talha-asad opened 6 years ago
It seems to work fine, if ctx.length is set
If the stream is sliced but the total length is determined then this could work with streams where total length is not known before hand
It falls in the section marked as // FIXME(Calle Svensson)
in the code.
If I set the ctx.length in my middleware, than it doesn't work right for smaller video files. confused ...
I have the exact same issue, also in the console I have these error messages :
Error: write ECONNRESET
at afterWriteDispatched (internal/stream_base_commons.js:154:25)
at writeGeneric (internal/stream_base_commons.js:145:3)
at Socket._writeGeneric (net.js:786:11)
at Socket._write (net.js:798:8)
at doWrite (_stream_writable.js:397:12)
at clearBuffer (_stream_writable.js:550:7)
at Socket.Writable.uncork (_stream_writable.js:332:7)
at connectionCorkNT (_http_outgoing.js:707:8)
at processTicksAndRejections (internal/process/task_queues.js:83:21)
Could it be related ?
@vdegenne What you reported error seems like the connection is reset, it should be not relevant.
@yorkie Yes but this message occurs only when I use koa-range
. Isn't that odd ?
https://github.com/koajs/koa-range/issues/20
It seems that these two issues are the same. I have fixed it.
Hello, This problem is not solved,Can you tell me a solution?
at afterWriteDispatched (node:internal/stream_base_commons:160:15)
at writeGeneric (node:internal/stream_base_commons:151:3)
at Socket._writeGeneric (node:net:817:11)
at Socket._write (node:net:829:8)
at doWrite (node:internal/streams/writable:408:12)
at clearBuffer (node:internal/streams/writable:569:7)
at Socket.Writable.uncork (node:internal/streams/writable:348:7)
at connectionCorkNT (node:_http_outgoing:797:8)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
https://github.com/koajs/koa-range/issues/14#issuecomment-624787616
hey, What version of koa-range are you using? I merged the fixes to git, but never published a new npm version. So unless you're referencing the latest git commit, you won't see the fixes.
sorry,i forgot this question, I used the version of "^0.3.0" for koa-range,how can i get this fix. https://github.com/koajs/koa-range/issues/14#issuecomment-1285710696
I haven't been able to publish this new code because: a) noone leftover from koa org is around anymore to review it b) PRs that I'm waiting on in other dependencies are not getting merged.
I'm planning to just publish this change, probably as 0.4.0 at some point this week, after I get a chance to do some more testing on my own, and bake in the updated deps.
ok, I expect to the new version, thank you for your reply. @mreinstein
@colinSnake I've merged my code to the master branch, so you can test this code by doing npm install koajs/koa-range
.
I was going to publish these changes to npm as 0.4.0-beta
but unfortunately I don't have npm rights on the koajs org, so I can't make this happen. Hopefully installing from github will be something you can test with.
If you're able to provide any feedback I'm happy to make adjustments.
Sorry it took so long!
With small video (mp4) files, chrome has no issues. However if I use a 34 mbish sort of a video file. It will sometimes play the first 2 secs, like (5%) of the file or just stay stuck in limbo and not respond to the request. The code I have is pretty simple:
It works fine on firefox, but I think firefox doesn't even use ranges for video. It also works fine when koaRange is removed as a middleware but then it would not seek, as expected. Using the latest version of koa and koa-range