Skip to content

Commit

Permalink
Properly format the playback duration
Browse files Browse the repository at this point in the history
  • Loading branch information
MGaetan89 committed Aug 12, 2024
1 parent 138ef77 commit 739e8b6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.annotation.StringRes
import androidx.lifecycle.AndroidViewModel
import androidx.media3.common.VideoSize
import ch.srgssr.pillarbox.demo.shared.R
import ch.srgssr.pillarbox.demo.shared.ui.getFormatter
import ch.srgssr.pillarbox.player.analytics.metrics.PlaybackMetrics
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
Expand Down Expand Up @@ -89,7 +90,7 @@ class StatsForNerdsViewModel(application: Application) : AndroidViewModel(applic
listOfNotNull(
getSessionInformation(R.string.session_id, value.sessionId),
getSessionInformation(R.string.media_uri, value.url?.toString()),
getSessionInformation(R.string.playback_duration, value.playbackDuration.toString()),
getSessionInformation(R.string.playback_duration, value.playbackDuration.getFormatter().invoke(value.playbackDuration)),
getSessionInformation(R.string.data_volume, value.totalBytesLoaded.toFloat().toFormattedBytes(includeUnit = true)),
getSessionInformation(R.string.buffering, value.bufferingDuration.toString()),
getSessionInformation(
Expand Down

0 comments on commit 739e8b6

Please sign in to comment.