Questions tagged [mpremotecommandcenter]

An Apple SDK Media Player object that responds to remote control events sent by external accessories and system controls.

74 questions
9
votes
1 answer

Difference between AVAudioPlayer AVPlayer AVQueuePlayer MPMusicPlayerController MPRemoteCommandCenter MPNowPlayingInfoCenter for an iOS 13+ app

All of the threads on this topic are really old (5+ yo), and I can't seem to form a clear MODERN approach, so hopefully this can be summarized for 2020 (Swift 5, Xcode 11). If you were to build an AUDIO (not just music) player app for the iPhone…
9
votes
1 answer

MPRemoteCommandCenter Error in swift 4

I am trying to setup my app to use MPRemoteCommandCenter. I got this example from the document programming guide. I imported AVFoundation and even tried importing AVKIT, I am getting the error Use of unresolved identifier 'MPRemoteCommandCenter'.…
Iam Wayne
  • 561
  • 6
  • 26
7
votes
2 answers

iOS media playback controls notification

I am new to iOS, and developing a cross platform app with Flutter. I am trying to play audio from network URL, which i found it can be done using the AVPlayer. The audio plays when the app is in foreground and in background, but i can display the…
medyas
  • 1,166
  • 13
  • 21
7
votes
1 answer

Prevent AVPlayerController from hijacking MPRemoteCommandCenter

I have a view controller with two separate players, an audio player with AVAudioPlayer and a video player with AVPlayerViewController. When the view is loaded both players are initialized as well with their sources but stay paused until the user…
6
votes
1 answer

MacOS not responding to MPRemoteCommandCenter commands in the background

I am writing an application for my own purposes that aims to get play pause events no matter what is going on in the system. I have gotten this much working let commandCenter =…
J.Doe
  • 1,502
  • 13
  • 47
6
votes
1 answer

AVAudioPlayer 'forgets' that its playing when triggered by MPRemoteCommand

I'm trying to play an audiofile and control it's playback via the Remote Command Centre available on the lock screen. If I do the following: Begin playback Pause playback Lock device Begin playback from lockscreen (MPRemoteCommandCenter) It is…
RP-3
  • 684
  • 4
  • 22
6
votes
1 answer

How is MPChangePlaybackRateCommand triggered?

I'm playing around with the audio features in iOS, and I'm looking at MPRemoteCommandCenter's changePlaybackRateCommand. I have enabled it, given it a target, and set its supportedPlaybackRates, but I don't see any related UI showing up in control…
Tom Hamming
  • 10,577
  • 11
  • 71
  • 145
5
votes
0 answers

MPRemoteCommandCenter not available after changing audio session category

My app has got the option to allow its sound to be mixed with other apps. According to Apple, MPRemoteCommandCenter is only available when apps do not allow for mixing. Inside my app, when the user taps the button to change the mixWithOthers…
5
votes
1 answer

Is there a way to show lock screen controls using AVAudioEngine and AVAudioPlayerNode?

I am handling audio playback using AVAudioEngine and AVAudioPlayerNode in my app, and I want to implement remote controls. Background audio is configured and working. Control center controls work, but the play/pause button does not update when I…
3
votes
0 answers

SwiftUI | How to display video title in control center of iPhone

I want to display video title in control center of iPhone. But, the title does not appear. What should I do? Xcode 14.0, Swift 5.7, iPhone8 iOS 16.0 import SwiftUI import AVKit import MediaPlayer struct ContentView: View { var body: some View { …
3
votes
0 answers

MPRemoteCommandCenter how to signal playback state when not using AVAudioPlayer

I have a simple MIDI player (Swift 5, SwiftUI, iOS14) and would like to toggle a play/pause command with MPRemoteCommandCenter. The control from the lock screen works fine with the following setup, but I'm struggling to find how to notify…
3
votes
0 answers

MPRemoteCommandCenter playCommand vs togglePlayPauseCommand?

I'm building a iOS media player that plays audio files using the AVPlayer. The player is all working fine. I'm now looking at controlling media playback from the lock screen and from headphones. I have implemented a target for…
JTODR
  • 318
  • 2
  • 10
3
votes
1 answer

How can I hide Remote Command Center when AVPlayer has finished to play a song?

I have an app playing mp3 with AVPlayer and I am struggling to hide the Remote Command Center when the track is finished. This is the func to setup my Remote Command Center. How can I hide it? func setupRemoteCommandCenter() { // Get the shared…
bablack
  • 129
  • 9
3
votes
1 answer

MPRemoteCommandCenter doesn't appear on iOS13

I have a video player that show a .m3u8 stream. I've tried to implement the Remote Control but the widget doesn't appear both in lock screen, in the Notification Center and in the Command Center. I need only to have play-pause, volume controls and…
mferre
  • 182
  • 1
  • 14
3
votes
0 answers

Control AKSequencer with MPRemoteCommandCenter

Is it possible to control AKSequencer with MPRemoteCommandCenter and if so what's the setup required for that? I had no issues with displaying and managing playback info using default AVAudioPlayer but it doesn't work with AudioKit.…
inokey
  • 5,434
  • 4
  • 21
  • 33
1
2 3 4 5