My current code includes the use of hls.js for playing hls streams. The original code is in ECMA version 6 and then transpiled into ECMA 5, which can be found in the dist folder (link provided). It works fine in most cases.
However, when trying to render it on Internet Explorer 8, syntax errors are encountered. I do not intend to utilize any functions from the library, just include it. Should I attempt to transpile the js file for compatibility with IE8 or should I look for alternatives?
EDIT
I attempted following suggestions from this source by including various shim scripts as below:
<html>
<h1> Testing IE new </h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-sham.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-sham.min.js"></script>
<script src="https://wzrd.in/standalone/es7-shim@latest"></script>
<script src="https://cdn.jsdelivr.net/hls.js/latest/hls.js"></script>
</html>
Despite this setup, the error persists in IE8 stating:
Expected identifier hls.js, line 320 character 31
EDIT 2
To address this issue, I created a .babelrc
file to transpile it into an es3
format and resolve additional issues:
{
"presets": ["es3"],
"plugins": ["transform-es3-property-literals", "transform-es3-member-expression-literals"]
}
However, a new error has emerged in IE8:
Object doesn't support this property or method hls.js, line 1063 character 17
The problem seems to be with the Object.defineProperty
method, which IE8 does not support. Is there a solution to fix this?