12-07-2011 02:57 AM
Hi,
So I'm new to Brightcove and using my trial account I can't get the onTemplateReady to fire.
I activated the AS/JS APIs in the console for the player I'm using.
The video gets loaded but the callback function won't be called... please help ?
Only difference I see with some BC examples is I don't have a providerId. I use a playerKey param instead, I think it's just the latest way to do it as I can find a providerId nowhere.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona l.dtd">
<html>
<head>
<title>Player API HTML Test </title>
<script type="text/javascript">
function onTemplateLoaded(experienceID) {
alert("onTemplateLoaded");
}
</script>
</head>
<body>
<!-- Start of Brightcove Player -->
<script type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperienc es.js"></script>
<script type="text/javascript" src="http://admin.brightcove.com/js/APIModules_all.js"></script>
<div style="display:none">
</div>
<!--
By use of this code snippet, I agree to the Brightcove Publisher T and C
found at http://corp.brightcove.com/legal/terms_publisher.c fm.
-->
<object id="myExperience" class="BrightcoveExperience">
<param name="bgcolor" value="#00FFFF" />
<param name="width" value="480" />
<param name="height" value="270" />
<param name="playerID" value="1301163662001" />
<param name="playerKey" value="AQ~~,AAABLI1oNrE~,4XL2HzzanPGYsblTGMtHblm3l 2VkQS4a" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="@videoPlayer" value="1301506734001" />
</object>
<script type="text/javascript">brightcove.createExperience s();</script>
<!-- End of Brightcove Player -->
</body>
</html>Thanks for any help.
Solved! Go to Solution.
12-07-2011 08:08 PM
Hi Gouegd,
Can you elaborate more on the issue you are having.
I am able to see the alert being fired inside onTemplateLoaded().
For Template Ready, you will have define the function onTemplateReady(), which I do not see in your code.
12-07-2011 08:59 PM - last edited on 12-07-2011 09:00 PM
Hi Maverick,
Sorry for mixing the function names. My problem is I don't get the alert, I'm surprised you do.
I tried on the latest Chrome & Firefox.
I do, however, get a Flash security popup which I have to close in order to have the video load, see below :

Could that be related ?
Update: I just tried it by putting my sample HTML page on Apache, and it's now working (with no Flash warning).
That's a problem for me however, as the project I'm working on will run locally. Would you know what is preventing the callback from being called in this case... And any way to work around this ?
Thanks,
Greg
12-07-2011 09:11 PM
Yes, you will have to provide access to *.brightcove.com in order for the API calls to work.
Otherwise they will not work. This is usually the case when you have files on your localhost.
12-08-2011 12:02 AM
Yep worked fine this way.
Thanks a lot ! :)
