I recently upgraded from 5.10 to 7.22 and am hosting the player and files myself.
In my <head>
is have the following:
<script src="https://content.jwplatform.com/libraries/secretKeyXXX.js"></script>
The in the <body>
I have the actual setup call:
<div id="actualvideo"></div>
<div class="video-controls">
<span class="playbtn">Play</span>
<span class="length">
<span class="elapsed"></span> / <span class="totaltime"></span>
</span>
<span class="captioning">CC</span>
<span class="fullscreen">Fullscreen</span>
</div>
<script>
$(document).ready(function () {
var playerInstance = jwplayer('#actualvideo');
playerInstance.setup({
file: 'https://s3.amazonaws.com/urlpath/@content["FileName"]',
image: '@content["Image"]',
width: 640,
height: 360,
title: 'Basic Video Embed',
description: 'A video with a basic title and description!',
mediaid: '123456'
});
$('.video-controls .playbtn').on('click', function (e) {
console.log('inside');
playerInstance.pause();
});
});
</script>
But it's resulting with this error:
Uncaught TypeError: playerInstance.setup is not a function
And I can't figure out why. I've set it up as described on their website.
Try var playerInstance = jwplayer('actualvideo');
instead of var playerInstance = jwplayer('#actualvideo');
The #
is wrong. It seems not to be an jquery selector and the vanilla getElementById()
is used ;)