Jump to content


These Forums Are Now Read-Only


For TubePress support, please post a question here or open a support ticket and we will be glad to assist.


Photo

Auto-close Shadowbox


Best Answer eric, 22 February 2013 - 05:02 PM

Any chance you are able to upgrade to TubePress 3.0.0? Things are kinda working as expected, but some JavaScript events that should be firing aren't.

 

Example, when I view your gallery here's what I see in the console: http://i.imgur.com/YVuAjwX.png. Compare that to the events that are fired on tubepress.org: http://i.imgur.com/aGtILa5.png. Ignore the errors - the important events that are missing from your site are the "tubepressPlaybackStarted" and "tubepressPlaybackPaused" events. In other words, TubePress isn't getting the right notifications from the YouTube player.

 

I'm not entirely sure why that's happening, but a lot was fixed between 2.4.5 and 3.0.0, so I think an upgrade would be worth a shot.

Go to the full post


  • Please log in to reply
7 replies to this topic

#1 danielwpugh

danielwpugh

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 17 February 2013 - 04:45 AM

I need the Shadowbox to close automatically when the YouTube video finishes playing. Any ideas?



#2 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 17 February 2013 - 10:02 PM

Hi,
 
This isn't a baked-in feature of TubePress, but it's possible if you are comfortable writing a little JavaScript. Something like this, added to the bottom of your page, should do the trick:

jQuery(document).ready(function () {

    jQuery(document).bind('tubepressPlaybackStopped', function () {

        Shadowbox.close();
    });
});

Two disclaimers. First, I haven't tested this code! Second, the "tubepressPlaybackStopped" event is not part of TubePress's public API and may change or be removed in future versions.

 

But otherwise, it's a fairly simple solution that should do the trick. Let us know how it works for you. Thanks!



#3 danielwpugh

danielwpugh

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 19 February 2013 - 05:24 PM

Thanks for the quick reply Eric! I'm pretty familiar for Javascript and jQuery and I know you said you didn't test the code, but I still couldn't get this to work. I know that everything is loading correctly and I'm not getting any debug messages in the console. Where might I be going wrong?

 

Thanks!!



#4 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 20 February 2013 - 01:58 PM

Hmm, that should work. Any chance you could send along a link to the site so I could take a first-hand look? Feel free to PM me the address if you can't share it with the world.

 

If you put TubePress into debug mode and open up the JavaScript console in your browser, TubePress will spit out a bunch of debugging messages that might be helpful.



#5 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 20 February 2013 - 04:18 PM

Thanks - I got your private message and took a peek. Could you verify that the box for "Enable JS API" under WP Admin > Settings > TubePress > Player is ticked? That feature is required in order to fire the jQuery events in the browser. It doesn't look like it's on to me, but it's tough to tell for sure..



#6 danielwpugh

danielwpugh

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 20 February 2013 - 04:25 PM

I was playing with that. It was off when you looked at it, but I turned it back on. Still not working though...



#7 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 22 February 2013 - 05:02 PM   Best Answer

Any chance you are able to upgrade to TubePress 3.0.0? Things are kinda working as expected, but some JavaScript events that should be firing aren't.

 

Example, when I view your gallery here's what I see in the console: http://i.imgur.com/YVuAjwX.png. Compare that to the events that are fired on tubepress.org: http://i.imgur.com/aGtILa5.png. Ignore the errors - the important events that are missing from your site are the "tubepressPlaybackStarted" and "tubepressPlaybackPaused" events. In other words, TubePress isn't getting the right notifications from the YouTube player.

 

I'm not entirely sure why that's happening, but a lot was fixed between 2.4.5 and 3.0.0, so I think an upgrade would be worth a shot.



#8 danielwpugh

danielwpugh

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 22 February 2013 - 05:47 PM

Upgraded to 3.0 and it's working!  :)

 

Only reason I hadn't was I didn't want to rebuild the styling, but it turned out to be pretty easy to copy it over once I found the new directory locations.

 

Thanks for the help.