01-31-2012 01:55 PM - edited 01-31-2012 01:57 PM
Hi there,
I'm trying to get the playerID but not luck yet. Could any body suggest how to get the player id from the brightcove code below using javascript?
few things I tried(within the function onTemplateLoad):
#1:
params = document.getElementsByName('playerID');
console.log(params) -----------------------------------> Return Object collection
console.log(params[0]) ---------------------------------> Returns undefined
#2:
var urlparams = brightcove.cacheUrlParams();
console.log(urlparams.playerID)
#3:
console.log(brightcove.api.getParameter(bcpid));
<object id="myExperience" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="955" />
<param name="height" value="546" />
<param name="playerID" value="969475895001" />
<param name="playerKey" value="AQ~~,AAAAAE3JUCw~,kE8Qu9bFVLtMNPSEPJFRQablL
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="autoStart" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="templateLoadHandler" value="onTemplateLoad" />
<param name="includeAPI" value="true" />
</object>
Solved! Go to Solution.
02-01-2012 12:00 PM - edited 02-01-2012 12:01 PM
Hey !
I was able to get the playerID using the following line of code:
var objId;
function onTemplateLoad(id) {
objId = id;
}
function onTemplateReady(event) {
playerId = brightcove.experienceObjects[objId].params.playerI
}
Brightcove Inc., a leading global provider of cloud content services, provides a family of products used to publish and distribute the world's professional digital media. The company's products include Brightcove Video Cloud, the market-leading online video platform, and Brightcove App Cloud, the pioneering content app platform. Together, more than 4,200 customers in 50 countries rely on Brightcove's cloud content services to build and operate exceptional media experiences across PCs, smartphones, tablets and connected TVs.
Brightcove Inc.
© 2012 Brightcove Inc.
