I too am having problems with iOS 11.3 even when using Beta 2 and the corresponding xcode beta.
My problem is that the audio will begin playing as soon as prepareToPlay is called. Consider the code below:
spinner.startAnimating()
appMusicPlayer.prepareToPlay(completionHandler: {[weak self] (error) in
self?.appMusicPlayer.currentPlaybackTime = ct
DispatchQueue.main.async { [weak self] in
self?.spinner.stopAnimating()
if error != nil {
self?.goIdle()
let alertController = UIAlertController(title: "Problem Playing Apple Music", message:
"Check network connection and try again. " + error!.localizedDescription, preferredStyle: UIAlertControllerStyle.alert)
alertController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default,handler: nil))
self?.present(alertController, animated: true, completion: nil)
} else {
self?.conditionallyBeginFadeIn()
self?.appMusicPlayer.play()
self?.playbackStartTime = (self?.appMusicPlayer.currentPlaybackTime)!
self?.playbackStartDate = Date()
}
}
})
Normally (like with iOS 11.2 and prior) the audio playback doesn't begin until the call to "appMusicPlayer.play()" in the completion handler. But with iOS 11.3 Beta 2, it will begin as soon as prepareToPlay is called.
I'm also noticing inconsistent problems getting and setting "currentPlaybackTime" as well.