Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

280
Views
How to update playback position in control center?

This is how I observe changes from command center:

    commandCenter.playCommand.addTarget(self, action: #selector(play))
    commandCenter.pauseCommand.addTarget(self, action: #selector(pause))
    commandCenter.changePlaybackPositionCommand.addTarget { event in
        let seconds = (event as? MPChangePlaybackPositionCommandEvent)?.positionTime ?? 0
        let time = CMTime(seconds: seconds, preferredTimescale: 1)
        self.player.seek(to: time)
        return .success
    }

When I change position of slider, my app receives callback and position of audio is updated, but... position of slider in control center brings back to the previous state. Why?

The question is:

Why it doesn't stay where I left the finger, instead of getting back to the previous position?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You have to set MPNowPlayingInfoPropertyPlaybackRate, MPMediaItemPropertyPlaybackDuration and MPNowPlayingInfoPropertyElapsedPlaybackTime of nowPlayingInfo. You want to update nowPlayingInfo every time you play/pause/skip.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!