Thanks so much for taking a look at this!
I downloaded and tried to open your example, but it wouldn’t open. Instead got this message: Document Version Incompatibility - The document you are trying to open was created with a newer version of Hype and cannot be displayed.
Are you using Hype 4?
My current version is 3.6.7.
Would you possibly be able to send me a version that I can open with Hype 3?
Wow, thank you so much for your help with this HansGerd!
Can’t tell you how grateful I am for your assistance.
And also thanks so much for hooking up the duration as well.
Just fantastic.
I wanted to thank you again for the help with the audio player.
It’s working wonderfully with my project!
However, the last feature I’m needing to add to this audio player is the ability to click on the audio scrubber and jump to that time in the timeline.
I’ve been trying to modify the clickToTime(); function in Mark Hunte’s video-controller example to get this to work in my project. But the setup is different enough that I’m having no luck.
Do you by any chance have any thoughts on what I can do to get a function like clickToTime() working with my audio player?
There’s a bit of complexity in getting the events entirely correct because you have the group as your scrubber; you may want to think about changing the knob to have your on drag action for it to work correctly. I got the basics by adding a “hit box” rectangle element with an opacity of 0% above the slider control. This was to get the width and hit target exacting. Then I added an on mouse click action that looks like:
var sliderWidth = hypeDocument.getElementProperty(element, 'width');
var percentComplete = event.offsetX / sliderWidth;
song.seek(percentComplete * song.duration());
@jonathan awesome.
This is exactly what I was trying to do, thanks so much!
I took your advice and put the drag action on the knob (makes sense and works better).
I also turned the bounding box of the scrubber group into the ‘hit box’ and adjusted its size and placement to get precise targeting.
It’s working great now .
Thanks so much for pointing me in the right direction!
All the best and thanks again.