ios – AVPlayer addPeriodicTimeObserver block is not called on CarPlay


I use AVPlayer addPeriodicTimeObserver to get notified the played time every one second. This works great if the playback is started from the app on the phone. However, if I start the playback on the CarPlay using the ‘Now playing’ app instead of my app, then, I can not get the played time any more. The callback block in addPeriodicTimeObserver is not called.

playTimeObserver = player.addPeriodicTimeObserver(forInterval: CMTimeMake(value: 1, timescale: 1), queue: nil) { [weak self] time in
        // callback here is not called if playback is started from the 'Now playing' app on CarPlay.
    }

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img