How do I interact between the player and javascript.
You can read about the possible interaction between javascript and the player in Jeroen's tutorial.
However for all javascript interaction you need to have the player id. Retrieving the ID of a player can be done with javascript as well, because it is possible to retrieve a player by its parents ID or in some similar way. Each of our players is placed inside a div that has the class "botrplayer" and an id with a random string. The id of the player is the same as the one for the div except we append swf to the id. This way we can retrieve the video's id like this:
function getPlayerId(parentId) {
divs = document.getElementById(parentId).getElementsByTagName('div');
for (var i = 0; i < divs.length; i++) {
if (divs[i].className == 'botrplayer') {
return divs[i].id + 'swf';
}
}
return false;
}
Once you have the id, you can do everything that is mentioned in the tutorial.
Return to the FAQ overview