removed unused import and fixed tests for swift testing

This commit is contained in:
Mauro Romito
2026-02-19 17:01:31 +01:00
committed by Mauro
parent 3dfcb6912f
commit 04dd0c005f
4 changed files with 18 additions and 25 deletions
@@ -41,9 +41,9 @@ protocol AudioPlayerProtocol: AnyObject {
var playbackURL: URL? { get }
var state: MediaPlayerState { get }
var playbackSpeed: Float { get }
var actions: AnyPublisher<AudioPlayerAction, Never> { get }
func load(sourceURL: URL, playbackURL: URL, autoplay: Bool)
func reset()
func play()
@@ -37,12 +37,12 @@ class AudioPlayerState: ObservableObject, Identifiable {
/// updates are delayed by a fixed amount of time
@Published private(set) var playerButtonPlaybackState: AudioPlayerPlaybackState
@Published private(set) var playbackSpeed: VoiceMessagePlaybackSpeed
private weak var audioPlayer: AudioPlayerProtocol?
private var audioPlayerSubscription: AnyCancellable?
private var playbackStateSubscription: AnyCancellable?
private var displayLink: CADisplayLink?
/// The file url that the last player attached to this object has loaded.
/// The file url persists even if the AudioPlayer will be detached later.
private(set) var fileURL: URL?
@@ -58,7 +58,7 @@ class AudioPlayerState: ObservableObject, Identifiable {
var isPublishingProgress: Bool {
displayLink != nil
}
init(id: AudioPlayerStateIdentifier, title: String,
duration: Double,
waveform: EstimatedWaveform? = nil,
@@ -119,7 +119,7 @@ class AudioPlayerState: ObservableObject, Identifiable {
func reportError() {
playbackState = .error
}
func setPlaybackSpeed(_ speed: VoiceMessagePlaybackSpeed) {
playbackSpeed = speed
audioPlayer?.setPlaybackSpeed(speed.rawValue)