Skip to content

Conversation

florianduros
Copy link
Member

@florianduros florianduros commented Oct 8, 2025

Fixes #30958
Revert part of #30961 to fix the root problem

@florianduros florianduros changed the title fix: duration of voice message in timeline Fix duration of voice message in timeline Oct 8, 2025
Copy link
Member

@Half-Shot Half-Shot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but needs an actual @element-hq/element-web-reviewers to check this.

// incomplete or stopped, thus giving an accurate position within the active
// clip segment.
return (this.context.currentTime - this.clipStart) % this.clipDuration;
return (this.context.currentTime - this.clipStart) % this.clipDuration || 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result of a modulo operation must always be an integer I think, so the only value where it could be falsy is 0 anyway?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a NaN at some point, one of the values wasn't an integer

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, of course

@florianduros florianduros added this pull request to the merge queue Oct 9, 2025
Merged via the queue into develop with commit b45488f Oct 9, 2025
43 checks passed
@florianduros florianduros deleted the florianduros/fix-audio-playback branch October 9, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The duration of the voice message cannot be displayed normally.
3 participants