Questions tagged [mpremotecommandcenter]

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

74 questions
1
vote
2 answers

MPRemoteCommandCenter - Remote controls on lock screen does not show up

I've implemented two functions in View controller (setupRemoteTransportControls() and setupNowPlaying()) and added one function to AppDelegate, but I'm still unable to see background audio controls of my app on the lock screen and also audio…
1
vote
1 answer

Testing CarPlay Audio using the simulator

I have developed an iOS radio audio app using Swift / UIKit and everything works well. I want to integrate wit CarPlay and got the required entitlements. I believe I have set everything up right for the most part as I can see the CPListTemplate with…
1
vote
1 answer

Use `AVSpeechSynthesizer` with `MPRemoteCommandCenter`

I need to use AVSpeechSynthesizer to read a text to my user. User will control reading with AirPods, so I need to use MPRemoteCommandCenter. For now, I need to prepare my audio files using AVSpeechSynthesizer.write(_:toBufferCallback:) the create a…
1
vote
1 answer

CarPlay - Show Now Playing screen in iOS 13

My app is already the current "now playing app" on the phone (i.e. all the required info are provided to MPNowPlayingInfoCenter) and it correctly shows in the lock screen, with artist name, track title, artwork image, etc. According to the docs,…
1
vote
2 answers

Can't catch bluetooth headset button click event in swiftui 2.0

I am trying to simply execute code on a click of a bluetooth headset button in a SwiftUI 2.0 app, but after trying many different codes, nothing have worked... Does someone have solved this issue? Based on apple docs and some answer I found on…
1
vote
1 answer

Can not find MPRemoteCommandCenter in scope

I have created a music application and now I wanted to add a feature to control the music from the lock screen and control center but I am getting the error, MPRemoteCommandCenter not in scope. Here is how my code looks. I am developing in XCode 12,…
Muskan Arora
  • 56
  • 11
1
vote
0 answers

Not Receiving Remote Command Center events while using Music Player Controller

I am trying to receive notifications from the remote command center for when the play/pause button is tapped so that I can appropriately update the image for my play/pause button. However, I am not receiving the notification of when the…
WY34
  • 261
  • 3
  • 10
1
vote
0 answers

Handle play/pause commands from AirPods while being in-call

Is there any way to handle a headset command while staying in an audio/video call originated from the same app? I'm working on the app that uses CallKit to make calls, and recently I got a task to allow muting a call when the user double-taps on…
1
vote
1 answer

Why does Swift AVAudioPlayer not change state after MPRemoteCommandCenter play command?

The environment for this is iOS 13.6 and Swift 5. I have a very simple app that successfully plays an MP3 file in the foreground or background. I added MPRemoteCommandCenter play and pause command handlers to it. I play the sound file in the…
Carl Smith
  • 1,236
  • 15
  • 18
1
vote
0 answers

Try to make MPRemoteCommand in swift

Hi every one i'm trying to make MPRemoteCommandCenter in swift it works fine but if i play AVPlayer from app the MPRemoteCommand play button not change , the pictures will show you what i mean and very sorry for the spelling mistakes because the…
1
vote
1 answer

changing the accessibility label in control center (remote command center)

I've got a simple app that plays a radiostation. I've added a MPRemoteCommandCenter to let the user control the audio via the control center. Thats all working fine. However, I want to change their accessibility labels. But this is the part where…
WalterBeiter
  • 2,021
  • 3
  • 23
  • 48
1
vote
0 answers

iOS 13 MPRemoteCommandCenter disconnect after background mode

Hi anyone run into issues when using AVPlayerViewController and set MPRemoteCommandCenter for control centre. When the app goes to the background the video keeps playing but the control centre disconnects? I used the example code from this post…
Charlie Wu
  • 7,657
  • 5
  • 33
  • 40
1
vote
0 answers

iPhone lock screen controls do not show up when AVPlayer is paused, how can I fix this?

I am streaming a video file but only playing the audio for it using AVPlayer. I am successfully able to play/pause, continue playing while in background, and interact with the lock screen controls to control the player. The only issue is if I pause…
1
vote
0 answers

Can't update iOS Remote Command Center for AVPlayer?

I have a simple video player (just an AVPlayer, playing an M3U8 video file) and I previously got it playing background audio just fine using the following: NSError *audioError; [[AVAudioSession sharedInstance]…
1
vote
1 answer

Swift MPRemoteCommandCenter nextTrackCommand gets called 3 times

I am using MPRemoteCommandCenter to change song in my music radio app. But when I press next track button from lock screen it jumps 3 steps insted of one. Here is my code: func setupRemoteTransportControls() { let commandCenter =…
Mat Koffman
  • 509
  • 1
  • 7
  • 18