Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

282
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda