mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-09 13:59:48 +01:00
fixed a bug that cut the last part of every voice messages. i.e. An audio message whose duration is 5.9 seconds was played for 5 seconds
Signed-off-by: Giacomo Pacini <giacomopacini98@gmail.com>
This commit is contained in:
parent
c0948ba478
commit
053407f900
@ -1639,10 +1639,10 @@ class ChatActivity :
|
||||
override fun run() {
|
||||
if (mediaPlayer != null) {
|
||||
if (message.isPlayingVoiceMessage) {
|
||||
val pos = mediaPlayer!!.currentPosition / VOICE_MESSAGE_SEEKBAR_BASE
|
||||
if (pos < (mediaPlayer!!.duration / VOICE_MESSAGE_SEEKBAR_BASE)) {
|
||||
val pos = mediaPlayer!!.currentPosition.toFloat() / VOICE_MESSAGE_SEEKBAR_BASE
|
||||
if (pos + 0.1 < (mediaPlayer!!.duration.toFloat() / VOICE_MESSAGE_SEEKBAR_BASE)) {
|
||||
lastRecordMediaPosition = mediaPlayer!!.currentPosition
|
||||
message.voiceMessagePlayedSeconds = pos
|
||||
message.voiceMessagePlayedSeconds = pos.toInt()
|
||||
message.voiceMessageSeekbarProgress = mediaPlayer!!.currentPosition
|
||||
if(mediaPlayer!!.currentPosition * 20 > mediaPlayer!!.duration){
|
||||
// a voice message is marked as played when the mediaplayer position
|
||||
|
Loading…
Reference in New Issue
Block a user