diff --git a/ios/App/Shared/player/AudioPlayer.swift b/ios/App/Shared/player/AudioPlayer.swift index 2cc60f64..e9086775 100644 --- a/ios/App/Shared/player/AudioPlayer.swift +++ b/ios/App/Shared/player/AudioPlayer.swift @@ -707,12 +707,13 @@ class AudioPlayer: NSObject { duration: currentChapter.getRelativeChapterEndTime(), currentTime: currentChapter.getRelativeChapterCurrentTime(sessionCurrentTime: session.currentTime), rate: rate, + defaultRate: tmpRate, chapterName: currentChapter.title, chapterNumber: (session.chapters.firstIndex(of: currentChapter) ?? 0) + 1, chapterCount: session.chapters.count ) } else if let duration = self.getDuration(), let currentTime = self.getCurrentTime() { - NowPlayingInfo.shared.update(duration: duration, currentTime: currentTime, rate: rate) + NowPlayingInfo.shared.update(duration: duration, currentTime: currentTime, rate: rate, defaultRate: tmpRate) } } diff --git a/ios/App/Shared/util/NowPlayingInfo.swift b/ios/App/Shared/util/NowPlayingInfo.swift index 86ca8ad4..69443fbe 100644 --- a/ios/App/Shared/util/NowPlayingInfo.swift +++ b/ios/App/Shared/util/NowPlayingInfo.swift @@ -53,14 +53,14 @@ class NowPlayingInfo { self.setMetadata(artwork: artwork, metadata: metadata) } } - public func update(duration: Double, currentTime: Double, rate: Float, chapterName: String? = nil, chapterNumber: Int? = nil, chapterCount: Int? = nil) { + public func update(duration: Double, currentTime: Double, rate: Float, defaultRate: Float, chapterName: String? = nil, chapterNumber: Int? = nil, chapterCount: Int? = nil) { // Update on the main to prevent access collisions DispatchQueue.main.async { [weak self] in if let self = self { self.nowPlayingInfo[MPMediaItemPropertyPlaybackDuration] = duration self.nowPlayingInfo[MPNowPlayingInfoPropertyElapsedPlaybackTime] = currentTime self.nowPlayingInfo[MPNowPlayingInfoPropertyPlaybackRate] = rate - self.nowPlayingInfo[MPNowPlayingInfoPropertyDefaultPlaybackRate] = 1.0 + self.nowPlayingInfo[MPNowPlayingInfoPropertyDefaultPlaybackRate] = defaultRate if let chapterName = chapterName, let chapterNumber = chapterNumber, let chapterCount = chapterCount {