mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
removed unused import and fixed tests for swift testing
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user