Stabilize iOS/watchOS/tvOS apps and add cross-platform audit remediation

This commit is contained in:
Trey t
2026-02-11 12:54:40 -06:00
parent e40275e694
commit acce712261
77 changed files with 2940 additions and 765 deletions

View File

@@ -7,10 +7,12 @@
import AVKit
import AVFoundation
import SharedCore
class AudioEngine {
static let shared = AudioEngine()
private init() { }
private let runtimeReporter = RuntimeReporter.shared
var audioPlayer: AVAudioPlayer?
var avPlayer: AVPlayer?
@@ -24,10 +26,11 @@ class AudioEngine {
options: [.mixWithOthers])
try AVAudioSession.sharedInstance().setActive(true)
avPlayer?.pause()
avPlayer = AVPlayer(playerItem: playerItem)
avPlayer?.play()
} catch {
print("ERROR")
runtimeReporter.recordError("Failed playing remote audio", metadata: ["error": error.localizedDescription])
}
#endif
}
@@ -41,10 +44,11 @@ class AudioEngine {
options: [.mixWithOthers])
try AVAudioSession.sharedInstance().setActive(true)
audioPlayer?.stop()
audioPlayer = try AVAudioPlayer(contentsOf: URL(fileURLWithPath: path))
audioPlayer?.play()
} catch {
print("ERROR")
runtimeReporter.recordError("Failed playing short beep", metadata: ["error": error.localizedDescription])
}
}
#endif
@@ -59,10 +63,11 @@ class AudioEngine {
options: [.mixWithOthers])
try AVAudioSession.sharedInstance().setActive(true)
audioPlayer?.stop()
audioPlayer = try AVAudioPlayer(contentsOf: URL(fileURLWithPath: path))
audioPlayer?.play()
} catch {
print("ERROR")
runtimeReporter.recordError("Failed playing long beep", metadata: ["error": error.localizedDescription])
}
}
#endif