1 (edited by garydav 2017-11-15 03:15:15)

Topic: How to find the status of AutoPlay

Hi,

I'm wondering whether AutoPlay is currently playing.

I've writing a jquery viewer that supports 3 modes: video, slideshow and virtual tours. Separate Divs hold each of the 3 media modes that are visible or hidden based on menu selections that the user clicks at the top of the screen.

My goal is to initially turn on autoplay when the users selects slideshow, but pauses the slideshow at the current slide if the user changes to another media mode, say, video.

Is there a way for me to know the state of autoplay? I have found your toggleAutoPlay function but need to know the current status of Autoplay in order to call toggleAutoPlay properly. Otherwise, if autoplay is not playing when I make the call, the slideshow will advance while another mode is playing.

In the debugger, I see that div.jb-bb-button.jb-bb-btn-autoplay.jb-status-playing is active when autoplay is playing. Must I query  this in jquery to find out whether the slideshow is playing or is their an easier way to accomplish this? Once I know the status, then I can correctly call toggleAutoPlay.

Thanks,
<gary>

Re: How to find the status of AutoPlay

Unfortunately, there are no API methods such as isAutoPlayActive() (which could be used to directly query the AutoPlay status) or onAutoPlay(playing) (which could be used to track the AutoPlay status).
The best course of action would probably be, as you suggest, to check the internal classes that Juicebox uses and look for .jb-status-playing which exists only when AutoPlay is active.
I realise that this is not an ideal solution but it should work.

If there are any features or functionality that you would like to see included in a future version of Juicebox, then I would encourage you to post them in the Feature Requests forum thread.
This keeps all the ideas together and ensures that they are not overlooked by the developers.
I do not know the likelihood of any suggestions being implemented but this is certainly the best place for all ideas.