unplugged_web Posted March 10, 2015 Share Posted March 10, 2015 I'm trying without much success to get flow player to work on a test website. I have it working on another site but on the test site it just doesn't work. I get an error saying ReferenceError: Can't find variable: fp. The full error is: [Error] ReferenceError: Can't find variable: fp onOpen (player.php, line 447) p (jquery.bpopup-0.8.0.min.js, line 6) (anonymous function) (jquery.bpopup-0.8.0.min.js, line 6) each (jquery-1.10.2.min.js, line 4) each (jquery-1.10.2.min.js, line 4) bPopup (jquery.bpopup-0.8.0.min.js, line 6) (anonymous function) (player.php, line 442) dispatch (jquery-1.10.2.min.js, line 5) handle (jquery-1.10.2.min.js, line 5) Line 447 in the player.php is fp.load(); The code I'm using to load the video (when somebody clicks a button is should load) is: $(".thumb-vid").click(function(){ $("#pop").bPopup({ modalClose: true, opacity: 0.6, positionStyle: 'fixed', onClose: function(e){ if (fp.loading) { e.preventDefault(); } else { fp.unload(); } }, onOpen: function(){ fp.load(); } }); I'd be grateful for any help on this please, I've tried the flow player forum but they said they couldn't help because I'm not trying to get it to work on one of their pages. I also tried using console.log ('fp'); but that didn't show anything at all Link to comment Share on other sites More sharing options...
justsomeguy Posted March 10, 2015 Share Posted March 10, 2015 Well, where are you defining the fp variable? Link to comment Share on other sites More sharing options...
unplugged_web Posted March 11, 2015 Author Share Posted March 11, 2015 That's here: <script type="text/javascript"> $(".player").flowplayer(); var fp=$(".player").data("flowplayer"); $("#fullscreen").click(function(){ if( !fp.playing && !fp.loading ) { fp.load(); } fp.fullscreen(); }); </script> Link to comment Share on other sites More sharing options...
justsomeguy Posted March 11, 2015 Share Posted March 11, 2015 I can't tell how those two pieces of code fit together. The error message says that there's no fp variable defined apparently, for whatever scope that piece of code runs. Maybe the code where you define the variable runs after the code trying to use it. Link to comment Share on other sites More sharing options...
unplugged_web Posted March 17, 2015 Author Share Posted March 17, 2015 I found the error, it was in the php before - it was preventing the fp from being defined at all. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now