if (bytesToRead >= len) {
ostream.write(buffer, 0, len);
bytesToRead -= len;
}
where the ostream.write() fails and throws an error
org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe
Also, further up the chain (in BaseContentService.java) there's some code that sets the response headers to Accept-Ranges: none
e.g. there's a comment
// If there is a direct link to the asset, no sense streaming it.
// Send the asset directly to the load-balancer or to the client
which I think is also involved. But what's stranger, is that despite this header, the failing mp4 still appears to stream... at least it plays right away when it's loaded. vs. the mp4 I created will show a spinner icon while the video is loading before it plays.
(Another note, in Chrome, it will make an initial request where Sakai will set the Accept-Ranges: none, but then Chrome makes another request right away that contains a "Range" header, so Sakai will instead set the response header to Accept-Ranges: bytes and the video streams just fine.)
Thanks and sorry that this is so complicated, but it's been quite an interesting problem! But I'm still confused about where the main point of failure is... the Sakai streaming code, Firefox, or the Load Balancer?
- Austin
Because if I run it through lesson builder and I "embed" the video on a lesson builder page, the video works fine, where it does NOT set the Accept-Ranges to "none". Instead, further down the in the code, it sets it to "bytes". But if I take the same file and "link" to it in a lesson builder page, then click on the link, the Accept-Ranges gets set to "none" and it fails.
However, it's still strange that only some videos exhibit the bad connection problem.
For the videos that don't fail, they also get their Accept-Ranges set to none, but again, it appears that those videos get fully downloaded before playing vs. streamed in parts for the failing videos. I couldn't see any obvious differences in the Sakai code, so maybe the coyote streaming library does something funky depending on the length, bitrate, or encoding?
Also, what is the purpose of setting the Accept-Ranges to "none"? I mean besides what this mozilla doc says
Is there any particular reason it's being set to 'none' in Sakai? was that supposed to make the browser download the file instead of play it?
I remember including support to these requests for the name
pronunciation feature, using Spring:
https://github.com/sakaiproject/sakai/pull/7211/files
Do you think is related to this issue?
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/CAKL84%3DkjtFHbx%2BsMgrDfJjBGTSpNKpJp9av%3DFWXZsiGt3AHdGA%40mail.gmail.com.
-- ----------------------------------------------- Miguel Pellicer CTO at EDF Website: https://www.edf.global LinkedIn: https://www.linkedin.com/in/mpellicer-edf Office Phone: +34 - 96 381 35 75 Request a meeting here: https://calendly.com/mpellicer -----------------------------------------------
This was on my list of todo's!No matter how many times we say "Sakai is not a streaming service" people still upload media. IMHO for well known media types we should offer minimal streaming capabilities.Here is what I was thinking of, For media types like audio and video by default when a user clicks them is to stream them and offer the option for downloading, and yes we would want to use springs streaming api vs rolling our own, which the PR that Miguel references does.There are likely some downsides to doing this that are not well known like: the overhead that Sam already mentioned, tying up threads for long periods of time so it needs to be well understood and probably configurable.-earle
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/e6e4c5b0-3095-e818-a6f7-900ede64110f%40entornosdeformacion.com.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/e6e4c5b0-3095-e818-a6f7-900ede64110f%40entornosdeformacion.com.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/CAKL84%3Dkm_xGcT5yY1a0cUUR9tWiUU_-ZLpUNAAQzT%3DHtB8Jg3Q%40mail.gmail.com.