AnsweredAssumed Answered

Custom share page javascript library not working: Uncaught ReferenceError: is not defined

Question asked by luchees on Apr 15, 2019

I have a custom page in share where I want to get a custom videoplayer from brightcove and play a video.

 

Now when I import the javascript I am not able to use the function inside the js file..

This is my custom share page, its in FTL format

i attached the javascript file I want to import

 


<!doctype html>
<#include "include/alfresco-template.ftl" />
<@templateHeader>
<@script type="text/javascript" src="${url.context}/res/modules/documentlibrary/doclib-actions.js" group="document-details"/>
<@script type="text/javascript" src="${url.context}/res/js/brightcove-player-loader.js"></@script>
<@templateHtmlEditorAssets />
</@>
<html>

<head>
<meta charset="UTF-8">
<title>Load Player Dynamically</title>

</head>

<body>

<div id="allVideos"></div>
<script type="text/JavaScript">

var myPlayer,
playerHTML,
videoAPI,
players=[],
playerCode='r1xssUpoz',
// +++ Set the data for the player +++
playerData = {
'accountId': '713178170001',
'playerId': 'r1xssUpoz',
'videoId': '6018453914001'
};

 

brightcovePlayerLoader({
refNode: '#player-container',
accountId: '123456789'
});
</script>
</body>

</html>

I get the error : 

Uncaught ReferenceError: brightcovePlayerLoader is not defined

I tried but this gave no solution:

$(document).ready(function() {})();
$(window).on('load', function() { // your code here});

Thank you for your help

Outcomes