tomas.fejfar
9 Jan 2012, 6:40 AM
I have a problem with carousel. I use it to display a presentation. There is an audio element. Based on the audio's currentTime (on audio element's timechange event) the slide is slided (i have from/to times stored with slides).
Problem is that I want to let the users slide the slides themselves for example to skip boring passages. Because current slide is depending on the audio time I change the audio time inside cardswitch event. Problem is that the events are obviously asynchronous - that means that the cardswitch is called even if cards were changed from the timechange event. That means that there is a race condition between the timechange event timer and user who want to switch slides. If timechange event is triggered and user slides at the same time it sometimes works and sometimes it reverts hit slide, because of the timechange won the racecondition :(
Do you please have any idea how to synchronize the event so that when user start the tap the timechange event will be supressed until the slide is finished. Or even better - how to suppress the cardswitch event for any event, that is not user-initiated.
Problem is that I want to let the users slide the slides themselves for example to skip boring passages. Because current slide is depending on the audio time I change the audio time inside cardswitch event. Problem is that the events are obviously asynchronous - that means that the cardswitch is called even if cards were changed from the timechange event. That means that there is a race condition between the timechange event timer and user who want to switch slides. If timechange event is triggered and user slides at the same time it sometimes works and sometimes it reverts hit slide, because of the timechange won the racecondition :(
Do you please have any idea how to synchronize the event so that when user start the tap the timechange event will be supressed until the slide is finished. Or even better - how to suppress the cardswitch event for any event, that is not user-initiated.