I am using jwplayer (version - 8.26).
I am getting the following errors in the console:
jw8-player-errors-reference 332001
Uncaught ReferenceError: jwplayer is not defined
Following is the error description from console
VM2378:2 Uncaught ReferenceError: jwplayer is not defined
at eval (eval at <anonymous> (main.js?v=7db5d0f849a2cbf25bae06b650e7cb17:1:14737), <anonymous>:2:8)
at eval (<anonymous>)
at main.js?v=7db5d0f849a2cbf25bae06b650e7cb17:1:14737
at Function.globalEval (main.js?v=7db5d0f849a2cbf25bae06b650e7cb17:1:14748)
at ea.fn.init.domManip (main.js?v=7db5d0f849a2cbf25bae06b650e7cb17:1:63440)
at ea.fn.init.append (main.js?v=7db5d0f849a2cbf25bae06b650e7cb17:1:60940)
at ea.fn.init.<anonymous> (main.js?v=7db5d0f849a2cbf25bae06b650e7cb17:1
I am using the code snippet as shown below. The error is happening when jwplayer is referenced at line "jwplayer.key" in the code below
<script type="text/javascript"
src="//content.jwplatform.com/libraries/XXXX.js"></script>
<script type="text/javascript">
jwplayer.key = "GO/bHvcIycFaixHqFyFeXsWuMA5+Yr1Dm+PmH6I3sZ0=";
</script>
<div class="on-air-items-container oai-show-live-video">
<div class="video-wrapper">
<div id="vid-1"></div>
<script type="text/javascript">
var playerInstance = jwplayer("vid-1");
playerInstance
.setup({
androidhls : true,
playlist: '//cdn.jwplayer.com/v2/media/xxxxx',
autostart : false,
width : "100%",
aspectratio : "16:9"
});
</script>
Questions:
- What is the reason for "jwplayer is not defined" error? I am getting this error even though I am loading jwplayer using
"script type="text/javascript" src="//content.jwplatform.com/libraries/XXXX.js"
- Is the error happening because the jwplayer is referenced just immediately after the jwplayer js is loaded?