Love the idea! This is definitely one feature with a few parts to it.
What I’m thinking is we add a timestamp that we set along with the starting song. There are two approaches I’m bouncing around in my head to make this work from a configuration perspective.
Adding A Config Variable
To initialize the start song time stamp on
Amplitude.init() like so:
This way when you initialize AmplitudeJS it will jump to the time in the start song in seconds.
Make Start Object
Instead of having two separate variables, we could do it as one object so we can expand this in the future. I’m thinking maybe something like:
This would be easy to expand if other initialization measures that aren’t covered for. Just a though. If you can think of any other start scenarios besides what we discussed, I’d recommend going with this route so we don’t flood the config.
How this would work
Mainly for me as I think about this, but we’d have to override the
preload so we don’t have it loading twice. What this would do is if there’s a start song & start time, we’d initialize the start song on the audio object, then set the time, but set
none so it doesn’t start loading right away and we end up with a double load.
If there are any other thoughts on this feature, let me know and we can plan out the implementation.