Hi guys -
I'm trying to integrate Chris Coyier's AnythingSlider (http://css-tricks.com/anythingslider-jquery-plugin/) with the YouTube API. When the video state is "play", I want to fire 'startStop(false)', and on video state 'pause' to fire 'startStop(true)'. But how can I use a function that's declared inside a plugin? I tried with something like $.anythingSlider.startStop() but to no avail. A simplified version of the function to check YouTube state change is shown below.
function onytplayerStateChange(state) {
switch(state) {
case 1: // playing
$("#jsfeedback").html("playing");
$.anythingSlider(startStop(false));
break;
case 2: // paused
$("#jsfeedback").html("paused");
$.anythingSlider(startStop(true));
break;
}
}
I'm not receiving any errors, and the Slider / Video work fine. But I cannot get the slider to stop on play.
Any thoughts? Many thanks.
EDIT: Fixed it myself, answer below