-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IE11 internal error in stream-controller.js #2337
Comments
Upon updating my
I noticed that
allowed my video to load an play as expected. I should also note that it's possible the issue lies in the way that I'm loading HLS.js -- directly linking the source instead of using the compiled output. Perhaps you have a build step which amends this line so it works as expected in Internet Explorer. |
Further investigation: I noticed that
In the case of Internet Explorer when I reached this line I noticed that Looking into the HLS.js variable, I noticed that
In the case of Internet Explorer, this function was exiting early because |
Looks like On line 78 this gets properly set here:
However later this gets improperly set on line 805 here:
Somehow between these two lines getting run the value of |
Continuing my investigation it looks like the major difference actually slipped in through a polyfill I had created:
These two functions (
I updated my polyfill like so:
So after a couple of hours of digging it looks like the root cause was: Issue with IE 11Internet Explorer 11 doesn't support |
Number.isFinite is polyfilled here. hls.js/src/polyfills/number-isFinite.js Lines 1 to 3 in 2bf8ec6
There is a build-step that goes through and replaces the usage with alternative usage. Lines 76 to 81 in f723c06
Rather than checking If that fixes your issue, I think using the compiled output would solve your issue. Hope this helps! |
Perhaps instead of a build step (which obfuscates the solution somewhat and more tightly couples your code with your build environment) it would be better to import the custom
This would allow you to remove the |
Perhaps, but the visitor helper prevents us from accidentally allowing IE11 incompatible code from being in the built bundle which was an issue. |
Curious, why are you directly using source versus the built bundle? Also, if it's a choice, can you switch to the built bundle? |
I’m building from source to reduce bundle size as described here: Instead of a build step to replace |
I see! That makes sense. I'd be happy to accept adding additional build parameters and defining them via CLI params for the build step so you can build your custom package with a lighter bundle size. I think that's a much simpler stepping stone to the eventual goal of the plugin system. I don't think it's likely we would switch away from the current technique for handling the polyfill. I believe it was put into place quite recently so that future code that is written won't accidentally break IE compat. Since it sounds like you already have a working solution for the custom build do you think you could submit a pull request with your additional defines? Thank you! |
I could, but it would take quite a long time. I’m not very familiar with the HLS.js source yet so I’d have to do a lot of digging and reading to figure out everywhere the conditionals were needed. |
No problem. If you find the time to do so, would be happy to accept! |
Now that video-dev#2337 has been implemented, the error code HLS_INTERNAL_SKIP_STREAM is no longer used anywhere in the code. This retires that error, and also cleans up the code that previously was responsible for handling that error being fired. Pre-work for video-dev#1936
Update
I've tracked the issue and left all of my original debugging notes here just in case they're of value to anyone. Ultimately the problem is: Internet Explorer does not support
Number.isFinite
(which is used in a few places in the HLS.js source code). A polyfill for this function is necessary for IE 11 support.A simple polyfill like
Number.isFinite = isFinite
is insufficient becauseNumber.isFinite
andisFinite
treatnull
differently.Original post:
I noticed a video of mine was not loading in IE11 so I traced the issue through the debugger and came upon line 265 of
stream-controller.js
in the method_fetchPayloadOrEos
:In Internet Explorer 11, when I reach this line,
bufferEnd
isnull
causing an error to be thrown by the log and_loadFragment
to never run. The variablebufferEnd
is populated frombufferInfo.end
, which is passed in as a parameter from_doTickIdle
, which builds the variable like so:Tracing this it looks like
bufferEnd
is only set (inbuffer-helper.js
) ifmedia.buffered
has a non-zero count of items. My guess is that in normal browsers this is likely true (perhaps it defaults to a single "buffered" object from 0 seconds to 0 seconds) but Internet Explorer may behave differently. Further research is necessary to narrow this down.The text was updated successfully, but these errors were encountered: