Skip to content

Commit

Permalink
fix audio lenght issue
Browse files Browse the repository at this point in the history
  • Loading branch information
trOnk12 committed Jul 31, 2023
1 parent 072fdd1 commit 72f8a8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ package com.wire.android.media.audiomessage

import android.content.Context
import android.media.MediaPlayer
import android.media.MediaPlayer.SEEK_CLOSEST
import android.media.MediaPlayer.SEEK_CLOSEST_SYNC
import android.net.Uri
import android.util.Log
import com.wire.kalium.logic.data.id.ConversationId
import com.wire.kalium.logic.feature.asset.GetMessageAssetUseCase
import com.wire.kalium.logic.feature.asset.MessageAssetResult
Expand Down Expand Up @@ -110,7 +113,9 @@ class ConversationAudioMessagePlayer
audioMessageStateHistory = audioMessageStateHistory.toMutableMap().apply {
put(
audioMessageStateUpdate.messageId,
currentState.copy(totalTimeInMs = AudioState.TotalTimeInMs.Known(audioMessageStateUpdate.totalTimeInMs))
currentState.copy(
totalTimeInMs = AudioState.TotalTimeInMs.Known(audioMessageStateUpdate.totalTimeInMs)
)
)
}
}
Expand Down Expand Up @@ -241,7 +246,7 @@ class ConversationAudioMessagePlayer
val isAudioMessageCurrentlyPlaying = currentAudioMessageId == messageId

if (isAudioMessageCurrentlyPlaying) {
audioMediaPlayer.seekTo(position)
audioMediaPlayer.seekTo(position.toLong(), SEEK_CLOSEST_SYNC)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
package com.wire.android.ui.home.conversations.messages

import android.content.Context
import android.util.Log
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
Expand Down

0 comments on commit 72f8a8d

Please sign in to comment.