The question is closely related to my past question here, but it is not the same.
Problem: to add a Play/Pause button in Chromeless Youtube here.
Attack: I added the below code like here (search "SERVERFAULT" in the code) or like below:
var playingtimes = 0;
function playPauseVideo(playingtimes) {
if (playingtimes % 2 == 0){
playVideo();
}else{
pauseVideo();
}
playingtimes += 1;
}
Then, I added near the end:
<a href="javascript:void(0);" onclick="playPauseVideo(playingtimes);">Play/Pause</a>
Error: the button works like Play-button, because playingtimes is EVEN ie 0 all the time. Errror is in the playingtimes-variable.
Question: How can I add a Play/Pause Button to the Chromeless Youtube?