我最近从5.10升级到7.22,我自己托管播放器和文件。
在我的<head>
中有以下内容:
<script src="https://content.jwplatform.com/libraries/secretKeyXXX.js"></script>
在<body>
中,我有实际的设置调用:
<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>
但它导致了这个错误:
Uncaught TypeError: playerInstance.setup is not a function
我不明白为什么。我已经按照他们网站上的描述进行了设置。
尝试var playerInstance = jwplayer('actualvideo');
而不是var playerInstance = jwplayer('#actualvideo');
#
错误。它似乎不是一个jquery选择器,并且使用了普通的getElementById()
;)