mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
improved the code so that we can use the AudioPlayerState directly to check the playback speed and added localization
This commit is contained in:
@@ -19,7 +19,6 @@ struct VoiceMessageRoomPlaybackView: View {
|
||||
let onPlayPause: () -> Void
|
||||
let onSeek: (Double) -> Void
|
||||
let onScrubbing: (Bool) -> Void
|
||||
let playbackSpeed: Float
|
||||
let onPlaybackSpeedChange: () -> Void
|
||||
|
||||
var body: some View {
|
||||
@@ -28,7 +27,8 @@ struct VoiceMessageRoomPlaybackView: View {
|
||||
size: .medium,
|
||||
action: onPlayPause)
|
||||
VStack(spacing: 2) {
|
||||
PlaybackSpeedButton(speed: playbackSpeed, onTap: onPlaybackSpeedChange)
|
||||
PlaybackSpeedButton(speed: playerState.playbackSpeed,
|
||||
onTap: onPlaybackSpeedChange)
|
||||
Text(timeLabelContent)
|
||||
.lineLimit(1)
|
||||
.font(.compound.bodyXSSemibold)
|
||||
@@ -135,7 +135,6 @@ struct VoiceMessageRoomPlaybackView_Previews: PreviewProvider, TestablePreview {
|
||||
onPlayPause: { },
|
||||
onSeek: { value in Task { await playerState.updateState(progress: value) } },
|
||||
onScrubbing: { _ in },
|
||||
playbackSpeed: playerState.playbackSpeed,
|
||||
onPlaybackSpeedChange: { })
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user