Thanks so much for this!
That sure does explain why
hypeDocument.isPlayingTimelineNamed(...) was not working for me. Makes sense now!
I added your code and that took care of the audio scrub sound issue wonderfully!
When the timeline IS playing and I try to control the timeline On Drag, it works absolutely perfectly! (I appreciate your tidying the code as well, thanks for the refactoring example!).
However, what I’m finding is that if the timeline is NOT playing, and then I try to drag the timeline, unwanted behavior occurs: both audio playback and timeline continuation is triggered when the
event['hypeGesturePhase'] === "end" is detected, whereas the timeline and the audio should both stay paused (but at the new location) and ready to play with the play button. This makes total sense that this would be happening, but I’m at a loss as to how I would make this part of it work since triggering the On Drag nullifies the playback status of the timeline!
It still seems like I’m going to need to somehow inject an
if statement that determines whether or not the timeline was playing, but it seems this would need to be indicated before the drag event is even triggered.
Perhaps would it work to make a global variable that can be set to something like
notPlaying when the timeline is manipulated (started, paused, or continued) outside of the function? That way, the global variable could be checked and reset inside the function rather than checking for
If this approach might work, how do I make a global variable in Hype - attach it to
Or, is there a better way altogether?
Overall, now that the sound issue is wonderfully taken care of, do you have any thoughts on how to check the status of the timeline (and get around the On Drag hijacking issue)?
Again, thanks for your input with this DBear.