Hi all,
I'm developing a plugin that counts the numbers of views of each video played on a playlist. I'ven looking on the forums and so many people are using the JavaScript API for doing this, but I can't do it this way because my videos are displayed on many sites.
In version 3x of the player I has a hack on the Player.as for doing this, but now that it is all OOP and has a plugin system I want to do it on that way.
So, there's what I need: I have a PHP code that calls the mySQL database and adds the views, I'm calling this PHP code from a URLRequest, I have to give it a ID value for the video.
I'm trying to do this on the Playlist.xml, I'm generating it dinamicaly, so, it's the easyer way.
My problem is that I dont know how to view the data parsed from this XML, I'm trying to do it with something like this, but it not working at all.
private function itemHandler(evt:ControllerEvent=null): void {
var fil:String = view.playlist[view.config['item']]['update'];
if(fil) {
config['file'] = fil;
} else if (view.config['update']) {
config['file'] = view.config['update'];
} else if (view.config['update.file']) {
config['file'] = view.config['update.file'];
}
try {
if(config['file']) {
//loader.load(new URLRequest(config['file']));
loader.load(new URLRequest('http://localhost/player/visittor.php'));
}
} catch (err:Error) {
view.sendEvent('TRACE', 'Update: '+err.message);
}
};
Thanks for any help!