mirror of
https://github.com/vector-im/element-web.git
synced 2025-10-17 18:32:20 +02:00
Merge pull request #6435 from matrix-org/travis/voice-messages/duration
Fix duration placeholder parsing for audio files
This commit is contained in:
commit
b3d14de181
@ -103,8 +103,8 @@ export class PlaybackClock implements IDestroyable {
|
|||||||
* @param {MatrixEvent} event The event to use for placeholders.
|
* @param {MatrixEvent} event The event to use for placeholders.
|
||||||
*/
|
*/
|
||||||
public populatePlaceholdersFrom(event: MatrixEvent) {
|
public populatePlaceholdersFrom(event: MatrixEvent) {
|
||||||
const durationSeconds = Number(event.getContent()['info']?.['duration']);
|
const durationMs = Number(event.getContent()['info']?.['duration']);
|
||||||
if (Number.isFinite(durationSeconds)) this.placeholderDuration = durationSeconds;
|
if (Number.isFinite(durationMs)) this.placeholderDuration = durationMs / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user