Animation playback can specify a duration for the animation. This used to be provided in updateOffset and elapsed function in Playback which made things confusing beacuse calculated state relied on duration so calling updateOffset with a duration that is different than what is provided to elapsed would generate bad values. The API needing the duration is a bit noisy. So I have added a setDuration function to save that as part of the playback functionality so make things more consistent and less error prone.
Animation playback can specify a duration for the animation. This used to be provided in updateOffset and elapsed function in Playback which made things confusing beacuse calculated state relied on duration so calling updateOffset with a duration that is different than what is provided to elapsed would generate bad values. The API needing the duration is a bit noisy. So I have added a setDuration function to save that as part of the playback functionality so make things more consistent and less error prone.