11-08-2011 03:42 PM - edited 11-11-2011 02:12 PM
So I need to retreive any videos reference ID number (something we created for each video ourselfs) with the player API.
Inside the plugin I'm working on (the GoogleAnalytics swf) I see these lines, and hoping for a similar way to get the reference ID:
var experienceId:Number = _bcExperience.getExperienceID(); var playerName:String = _bcExperience.getPlayerName(); var video:Object = _bcVideo.getCurrentVideo(); var playlistId:Number = video.lineupId; var videoId:Number = video.id; var videoName:String = video.displayName;
Solved! Go to Solution.
11-10-2011 11:48 AM - edited 11-10-2011 05:22 PM
Hi Robert this is what I've tried, but I'm getting an error:
refID = _bcVideo.referenceId(); //refID = _bcVideo.getCurrentVideo().referenceId(); var experienceId:Number = _bcExperience.getExperienceID(); var playerName:String = _bcExperience.getPlayerName();
1061: Call to a possibly undefined method referenceId through a reference with static type com.brightcove.api.modules:VideoPlayerModule.
Update: Doing a bit more research it seems that referenceID is a keyword only used in the MediaAPI? Can it be used by the VideoAPI?
So this is how we're at this crossroads, I need to do a check on our reference ID / Video ID in order to serve a tracking pixel.
Currently how the part of our Embed code looks like that our PHP dev created:
<param name="@videoPlayer" value="ref:TS_950" />
Our problem would be easily solved if I could just grab the reference ID right here, however I believe the @ symbol is causing problems. Nothing comes in when I try:
videoID = this._bcStage.root.loaderInfo.parameters.@videoPla
Alternately we could make another param, but we're basically adding another line containing the same content :( so figured let's use the Player API to get the video's reference ID. However this is where I'm stuck still...
11-17-2011 06:45 PM
How are you defining your _bcvideo ?
video = player.getModule(APIModules.VIDEO_PLAYER); // MY video Object
and then I have put an alert inside my onTemplateReady() as follows :
alert("Reference ID is =" +video.getCurrentVideo().referenceId); // Using the video Object
which gives me the value of reference ID (which is the value in studio as shown in the image by you )
Let me know if this helps.
11-18-2011 12:37 PM - edited 11-18-2011 12:38 PM
That worked!!!! Thank you!
ok I found out what the problem was, instead of "ref:TS_950" it spat out TS_950
but that's all I need, I can just run a check againts that!