mpnowplayinginfocenter

Can I hide the rewind button in the iOS Lock Screen Music controls?

馋奶兔 提交于 2019-12-03 12:38:38
My app doesn’t support going back to previous tracks, and I’m wondering if I can tell the lock screen music controls to hide their rewind/previous track button. I use the MPNowPlayingInfoCenter to communicate that information to the lock screen. Pretty simple question, can it be done? For instance, to only show Play/Pause, and Skip Forward? Lysann Schlegel As of iOS 7.1 there is a way to customize the controls available in the lock screen and command center (and probably many other accessories): MPRemoteCommandCenter . Regarding your question you can do the following: [MPRemoteCommandCenter

MPNowPlayingInfoCenter not reacting properly when pausing playback

怎甘沉沦 提交于 2019-12-02 17:51:58
I am trying to get MPNowPlayingInfoCenter to work properly when pausing playback. (I have a streaming music app that uses AVPlayer for playback, and I am playing back in my Apple TV over Airplay.) Everything but pausing seems to be reflected correctly in the Apple TV UI. I am initializing it like this: MPNowPlayingInfoCenter *center = [MPNowPlayingInfoCenter defaultCenter]; NSDictionary *songInfo = @{ MPMediaItemPropertyTitle: title, MPMediaItemPropertyArtist: artist }; center.nowPlayingInfo = songInfo; Since I am streaming, I do not have duration info upon starting the playback. When I get

Play/Pause and Elapsed Time not updating in iOS command center properly

给你一囗甜甜゛ 提交于 2019-12-01 15:11:27
I have a video player that can play from the iOS command center and lock screen. When I toggle a play/pause button in my app, it should update the play/pause button in the command center ( MPRemoteCommandCenter ) by updating the nowPlayingInfo ( MPNowPlayingInfoCenter ). I'm not sure why it's not updating. For example, if I pause the video with a custom button in my app, the command center still shows the pause button (meaning the video is still playing which is wrong.) This is how I update the nowPlayingInfo : func updateMPNowPlayingInforCenterMetadata() { guard video != nil else {

Swift. Receive remote control events to work with MPNowPLayingInfoCenter

放肆的年华 提交于 2019-12-01 12:04:57
As I understand, in order to show music player on lock screen, writing the following code is not enough. override func viewDidAppear(animated: Bool) { var mpic = MPNowPlayingInfoCenter.defaultCenter() mpic.nowPlayingInfo = [ MPMediaItemPropertyTitle:"This Is a Test", MPMediaItemPropertyArtist:"Matt Neuburg" ] } My app also should be able to receive remote control events So, how to do that in Swift? I found this from Apple Documentation , but it's for Objective-C. - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; // Turn on remote control event delivery [[UIApplication

App for jailbroken iOS device: Consistent background operation

本秂侑毒 提交于 2019-12-01 10:42:52
I am the author of a Cydia tweak called AirFloat. An app that implements the AirPlay audio protocol (previously known as AirTunes), making it possible to stream audio to your iOS device. AirFloat is originally an App Store app, until it got booted by Apple from the App Store. I've since that made it available for free in Cydia. Currently the app stands in Cydia exactly as the previous App Store version. As a result of this I get a lot of requests to make it work in the background. But I cannot get it to work. Basically I am thinking of two approaches. Note: AirFloat displays the currently

iOS - updating the media play/pause state in the multitasking bar

三世轮回 提交于 2019-12-01 06:03:50
问题 We have a working app that uses an AU graph - CoreAudio API - to play audio. The graph is always running, and the play/pause state of the various source material is managed in the graph rendering callback functions. We successfully respond to UIEventTypeRemoteControl events, and we successfully update the lock-screen with the meta-data for the currently playing content using MPNowPlayingInfoCenter. The one missing piece is to update the state of the play/pause button in the iOS multitasking

Play/Pause next/Prev buttons are greyed out in control center

瘦欲@ 提交于 2019-12-01 05:54:09
问题 In my application, playback is controlled from control center. When playback is going on in AVPlayer(At this time playback controls are working fine from control center), I am loading a webview with other streaming URL. Once streaming is done again I am starting playback from AVPlayer. After this, Playback controls are greyed out in control center. I am using [MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo to enable playback control in control center. What would be the problem? 回答1: I

Apple Music conflicting with MPNowPlayingInfoCenter

◇◆丶佛笑我妖孽 提交于 2019-12-01 04:16:10
I need some help with an issue when my music player app is playing on background. I'm able to play the musics in the app and in the background with both services. I'm also able to set the MPNowPlayingInfoCenter and it displays the correct info, but the play/pause, next track and previous tracks are working only when the user is authenticated with Spotify: notifications are received correctly by the app when the user authenticates with Spotify but it doesn't work when user authenticates with Apple Music. In this case it seems that Apple Music is the one receiving the notifications. I'm using an

Get current track playing on control center iOS

做~自己de王妃 提交于 2019-11-30 18:04:00
问题 I'm looking to get the current track playing on iOS whatever the app which is playing the track. I mean, for example, if I use SoundCloud or Spotify on my phone, the player on control center is the same, so I think it's possible to get the current track name. However I don't know how to do this, maybe someone could help me ? 回答1: Frustratingly you can only get the details of the songs playing on the Music (iPod) app: // Print the title of the currently playing song. NSLog(@"%@", [[

Get current playing song from Spotify iOS app

末鹿安然 提交于 2019-11-30 02:53:40
I'm trying to get info about the current playing song in Spotify iOS app. The scenario is as follows: Open Spotify iOS app, start playing a song. Put the app in background and open my iOS app. Is there any way I could get the song playing on Spotify, in my iOS app? I have tried using the nowPlayingItem property as described in this post, but it didn't work: On iPhone: Find out what song is currently playing? (in the iPod music player) I have tried using the [MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo as described in this post, but it didn't work: Is there a way to access the