Reply
Regular Contributor
leongaban
Posts: 97
Registered: ‎07-29-2011
0 Kudos
Accepted Solution

How do you obtain / get the video reference ID via the player API?

[ Edited ]

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;

 

 

Administrator
BC-Robert
Posts: 237
Registered: ‎02-12-2010
0 Kudos

Re: How do you obtain / get the video reference ID via the player API?

Hi Leon,

 

It should come back as referenceId in the videoDTO returned by getCurrentVideo()

 

Robert

Regular Contributor
leongaban
Posts: 97
Registered: ‎07-29-2011
0 Kudos

Re: How do you obtain / get the video reference ID via the player API?

[ Edited ]

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();

 

Error:

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?

 

 

 

Additional info

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.@videoPlayer;

 

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...

 

Brightcove Team
BC-Maverick
Posts: 40
Registered: ‎04-01-2011
0 Kudos

Re: How do you obtain / get the video reference ID via the player API?

Hi,

 

How are you defining your _bcvideo ?

 

I have an working example using javascript, where I have the following : 

 

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.

Regular Contributor
leongaban
Posts: 97
Registered: ‎07-29-2011
0 Kudos

Re: How do you obtain / get the video reference ID via the player API?

[ Edited ]

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! 

 

 

Brightcove Team
BC-Maverick
Posts: 40
Registered: ‎04-01-2011
0 Kudos

Re: How do you obtain / get the video reference ID via the player API?

Awesome...Glad to help !

 

Great balls of fire !!!