Currently, I am using hls.js in my code to play hls streams. The original code is written in ECMA version 6 and then transpiled into ECMA 5 and places in the dist folder (above link). It works perfectly elsewhere.
I don't plan to use any if the functions from the library. I simply want to include it. Rendering it on IE8 gives errors about the syntax.
Is it possible to transpile the js file into a version compatible with IE8 or I should simply find a way to not include the file at all?
EDIT
Following this I tried doing the following:
<html>
<h1> IE test 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>
However, it still gives the following error on IE8:
Expected identifier hls.js, line 320 character 31
EDIT 2
I used the following .babelrc
file to transpile it to es3
file and fix some other errors.
{
"presets": ["es3"],
"plugins": ["transform-es3-property-literals", "transform-es3-member-expression-literals"]
}
However, now I face the following error on IE8
.
Object doesn't support this property or method hls.js, line 1063 character 17
The specific error is on the line Object.defineProperty
. It seems IE 8 does not support the defineProperty
method. Is there a way to fix this.`?