mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Removing Dead Code part 1 (#2234)
This commit is contained in:
@@ -46,12 +46,13 @@ class AudioPlayer: NSObject, AudioPlayerProtocol {
|
||||
|
||||
private var statusObserver: NSKeyValueObservation?
|
||||
private var rateObserver: NSKeyValueObservation?
|
||||
private var playToEndObserver: NSObjectProtocol?
|
||||
private var appBackgroundObserver: NSObjectProtocol?
|
||||
private var autoplay = false
|
||||
|
||||
private let audioSession = AVAudioSession.sharedInstance()
|
||||
|
||||
// periphery:ignore - when set to nil is automatically cancelled
|
||||
@CancellableTask private var releaseAudioSessionTask: Task<Void, Never>?
|
||||
|
||||
private let releaseAudioSessionTimeoutInterval = 5.0
|
||||
|
||||
private(set) var url: URL?
|
||||
|
||||
@@ -19,7 +19,6 @@ import Foundation
|
||||
|
||||
enum AudioPlayerError: Error {
|
||||
case genericError
|
||||
case loadFileError
|
||||
}
|
||||
|
||||
enum AudioPlayerAction {
|
||||
|
||||
@@ -110,7 +110,7 @@ class AudioPlayerState: ObservableObject, Identifiable {
|
||||
playbackState = .stopped
|
||||
}
|
||||
|
||||
func reportError(_ error: Error) {
|
||||
func reportError() {
|
||||
playbackState = .error
|
||||
}
|
||||
|
||||
@@ -167,6 +167,7 @@ class AudioPlayerState: ObservableObject, Identifiable {
|
||||
displayLink?.add(to: .current, forMode: .common)
|
||||
}
|
||||
|
||||
// periphery:ignore:parameters displayLink - required for objc selector
|
||||
@objc private func updateProgress(displayLink: CADisplayLink) {
|
||||
if let currentTime = audioPlayer?.currentTime, duration > 0 {
|
||||
progress = currentTime / duration
|
||||
|
||||
Reference in New Issue
Block a user