Unwanted audio file behavior `onend`. Stumped on how to hide, delay or override timeline behavior

@MarkHunte, I did indeed try this last code, thanks for double checking about that.

I also copied and pasted in the entire setup() code you used and gave that a whirl (even cleared my browser cache just to make sure).

To document my results, I took a quick screen vid of what my browser preview looks like when I paste in your entire setup() code.
Click here to check out the vid.
Is this the same results you are getting?

I get the same behavior on the test file and the real version.

This vid shows the following: when autoPlay is on and I scrub to the end, instead of the flash, it resets back to the beginning of the track and the lyrics snap back along with it before the scene transition (curiously, this is actually the original behavior I was trying to fix by adding the song.seek(song.duration()); code in the onend option).

Alas, this still seems like it’s not working as hoped on my mac. :frowning:

Despite all of these wonderful efforts, due to time constraints, I’m thinking I need to look for other simpler solutions.

In this regard, I do have one other avenue that I’m considering that I know will work (although it would not be my first choice from a design perspective), which is to keyframe the lyrics fading in and out directly into the autoScroll timeline. This avoids the glitchy flash altogether because when the track resets, the lyrics are invisible.

The downside to this setup is the lyrics would not be visible at all until (and while) the song is playing. I’d have preferred to have the lyrics visible when the scene loads, partially in order to avoid the visual awkwardness of having a big void of grey on the right column where the lyrics go. As a potentially workable solution to this, I’m realizing that If I superimpose a barely visible closeup portion of the band logo inside of this grey patch I could probably make it look pretty good (and most importantly - intentional).

In trying to work with what I’ve got (and in order to go with what is working), I think this may be an acceptable 2nd choice alternative to having the lyrics on display at all times. I did some testing with it today and I think it could look pretty good. In a best case scenario, if I can find a compelling enough way to visually work this, hopefully it will come across as a cool feature to have the lyrics appear on song start and disappear on song end.

Again, I so appreciate your help (and valuable time) with this, but out of time limit constraints, I’m leaning toward considering this alternative direction as my next best option.

Again, thanks so much for your help with this.

1 Like

Hey @MarkHunte,

In thinking about this more, I just wanted to make sure I’m not leaving this path of looking for a code solution too soon. I also very much don’t want to brush off all of the awesome support you (and the other good folks from the Hype community) have offered.

Honest question here: in your expert opinion, knowing that one of the tricky factors I’m up against is a time crunch - do you think a code solution to this glitch is likely attainable and worth pursuing without a major reworking of the code?

If so, I’d be up for continuing the troubleshooting process (and the last thing I want do is to give up too soon).

However, I also don’t want to continue down this road if the fix is going to take a lot of time and effort on your part - that’s not fair to you when it’s not even your project.

I think all-in-all, I’m just trying to think practically here so that I can finish this project expeditiously for my client and also graciously for those that have helped along the way, such as yourself.

Not to belabor the point, but you and the other Hype leaders are so generous with your time and expertise I want to make sure and emphasize that none of the help is taken for granted. But on the same token, I would also be bummed if you thought that I was giving up too soon or not exploring possible realistic solutions if you think one might be hiding around the corner.

I would totally understand if you don’t have any input on whether or not to continue digging for solutions. But since you have already put in time on this, and since you have familiarity with the code I’m working with, I’d value any honest input you might have (even if it’s a gut reaction).

If time was no issue, I’d be there in a heartbeat to keep digging, because I know I’d learn a ton whether the search ended in soil or treasure, but if a 2nd choice solution is a viable possibility, then I’m also willing to save the time and go with that (even if it’s not the ideal solution I was hoping for).
I hope that all makes sense. Again, all the best!

what about setting a condition for the redraw of the timelines in the stepfunction:

  if(song.seek() != song.duration()){//not the end of the song ... then draw ... else no redraw
            hypeDocument.goToTimeInTimelineNamed((hypeDocument.durationForTimelineNamed("Scrubber" + nr) * percentComplete), "Scrubber" + nr);
                hypeDocument.goToTimeInTimelineNamed((hypeDocument.durationForTimelineNamed("AutoScroll" + nr) * percentComplete), "AutoScroll" + nr);
                }

I’d suggest this’ll stop resetting the texttimeline ‘onend’ …

btw: at the moment the progressdocumentation resides ‘onload’ … should be better located in ‘onplay’

may work :slight_smile:

My honest feeling the stumbling block is we are trying not to change the project construction too much.
I do feel there should be a way without changing things up too much but I could not say how long that would take as there is a lot going on in behaviour that we do not want to change ( I suspect we will slap our foreheads when we find it )

Changing things to webAudio may solve the issue but may take you a bit to construct. Although I think if you get the loader working then transplanting it into your code may not be as bad as it looks like it would.

note all the maybes
So honestly I cannot give you the guidance you want on direction to go.

I am happy to keep digging though and the excellent @h_classen interest seems to be biting… :smiley:

1 Like

Hi @MarkHunte,

Your most recent comment was actually very helpful as it further puts things in perspective for me.

Great news is, I think I’ve had a bit of an epiphany with this!

Yesterday I had a chance to build out the notion of key-framing the lyrics starting out as invisible and fading in on song start and fading out to invisible on song end. I also key-framed a corresponding fade-out and fade-in of the closeup band logo superimposed into the grey space where the lyrics go.

Short answer is - I had that forehead slapping moment that you were talking about - it looks and behaves absolutely wonderfully!

As I was building this out I jotted down positives that were emerging from this new setup, and I now have at least (literally) 12 compelling reasons why this design solution is better than the way it was (or would have been, had we gotten it to work as intended).

So I now know exactly what I need to do. I’m going to build out the rest of site with this setup (I only did the testing on the first song/scene), and present it to the client along with my design notes. I am fully confident that they will like the changes to the lyric behavior in spades. :slight_smile:

In the meantime, it just goes to show that it some of the best solutions come about when faced with stumbling blocks and barriers (and broken code, lol!).

Plus, I’m happy to have learned a great deal about this quirky restart behavior in howler.js. The information gleaned from this process will certainly be good to know for my own future projects and hopefully other audio-focused Hype builders will also benefit as well :).

Thanks again for all of your help with this and being willing to keep digging (of course my curious side still wants to know what the definitive solution would have been). But in the meantime, I’m just so happy that it seems a better solution came about from all of this than I was even originally seeking! As a result, I’m considering this case closed.

I’m really excited to share this project with the community once it’s done. :slight_smile:
In the meantime, all the best to you and yours and again happy 2019!

2 Likes