mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-04 18:15:01 +02:00
Send report when playback ends
This commit is contained in:
parent
15b7fbce47
commit
394363c8cb
2 changed files with 5 additions and 7 deletions
|
@ -460,13 +460,13 @@
|
|||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 6;
|
||||
DEVELOPMENT_TEAM = 7UFJ7D8V6A;
|
||||
DEVELOPMENT_TEAM = N8AA4S3S96;
|
||||
INFOPLIST_FILE = App/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MARKETING_VERSION = 0.9.43;
|
||||
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.audiobookshelf.app.development;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.audiobookshelf.app.dev;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "App/App-Bridging-Header.h";
|
||||
|
@ -484,7 +484,7 @@
|
|||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 6;
|
||||
DEVELOPMENT_TEAM = 7UFJ7D8V6A;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
INFOPLIST_FILE = App/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
|
|
|
@ -60,6 +60,7 @@ class AudioPlayer: NSObject {
|
|||
playerItem.addObserver(self, forKeyPath: #keyPath(AVPlayerItem.status), options: .new, context: &playerItemContext)
|
||||
|
||||
self.audioPlayer.replaceCurrentItem(with: playerItem)
|
||||
seek(playbackSession.currentTime)
|
||||
|
||||
NSLog("Audioplayer ready")
|
||||
}
|
||||
|
@ -155,7 +156,6 @@ class AudioPlayer: NSObject {
|
|||
}
|
||||
|
||||
self.rate = rate
|
||||
|
||||
self.updateNowPlaying()
|
||||
}
|
||||
|
||||
|
@ -258,14 +258,11 @@ class AudioPlayer: NSObject {
|
|||
if playerStatus == .readyToPlay {
|
||||
self.updateNowPlaying()
|
||||
|
||||
let firstReady = self.status < 0
|
||||
self.status = 0
|
||||
if self.playWhenReady {
|
||||
seek(playbackSession.currentTime)
|
||||
self.playWhenReady = false
|
||||
self.play()
|
||||
} else if (firstReady) { // Only seek on first readyToPlay
|
||||
seek(playbackSession.currentTime)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -273,6 +270,7 @@ class AudioPlayer: NSObject {
|
|||
if keyPath == #keyPath(AVPlayer.rate) {
|
||||
self.setPlaybackRate(change?[.newKey] as? Float ?? 1.0, observed: true)
|
||||
} else if keyPath == #keyPath(AVPlayer.currentItem) {
|
||||
NotificationCenter.default.post(name: NSNotification.Name(PlayerEvents.update.rawValue), object: nil)
|
||||
NSLog("WARNING: Item ended")
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue