Only a bloggy thing at moment so not important but annoying!! Using Google Youtube api to kick off another function when someone starts a youtube video. The change state handlers below work fine, and the function gets called if you start either video. But it then won't call the function for the other video even though the handler is called and state is correct.
To be a bit clearer say I start video 1 first. The alert in changeplay1 reports state to be 1 and the lyrics function is called. If I start video 1 second the alert in changeplay1 still reports state to be 1 and yet the function does not get called. If state is 1 how can if (state==1) suddenly not work? Wierd.
function changeplay2(state)
{
alert("Player 2 new state:X" + state + "X");
if (state==1) showlyrics('showlyrics2','lyriclines2','lyrictimes 2');
}
function changeplay1(state)
{
alert("Player 1 new state:X" + state + "X");
if (state==1) showlyrics('showlyrics1','lyriclines1','lyrictimes 1');
}
function showlyrics(showline,llist,tlist)
{
alert("LYRICS ",showline);
etc
Have tried "1", 1*state etc in case state is a string or has appended spaces etc. There are no jscript errors. Any other bright ideas?
Cheers.
To be a bit clearer say I start video 1 first. The alert in changeplay1 reports state to be 1 and the lyrics function is called. If I start video 1 second the alert in changeplay1 still reports state to be 1 and yet the function does not get called. If state is 1 how can if (state==1) suddenly not work? Wierd.
function changeplay2(state)
{
alert("Player 2 new state:X" + state + "X");
if (state==1) showlyrics('showlyrics2','lyriclines2','lyrictimes 2');
}
function changeplay1(state)
{
alert("Player 1 new state:X" + state + "X");
if (state==1) showlyrics('showlyrics1','lyriclines1','lyrictimes 1');
}
function showlyrics(showline,llist,tlist)
{
alert("LYRICS ",showline);
etc
Have tried "1", 1*state etc in case state is a string or has appended spaces etc. There are no jscript errors. Any other bright ideas?
Cheers.

Comment