iOS twice click for music controller to start - ios

I have music app and I have fully implementation for background but I found one bug when I refactor my design with SwiftUI. When I click pause in my music app and go to backround and try click to play from native iOS music controller I need click twice for play.... And I can't find why? then when it starts playing everything works fine
maybe someone faced a similar problem?

Related

Strange behaviour in iOS Today Widget with AVPlayer

I'm really getting crazy on this, so I'd ask for some help.
I'm coding a little widget that presents two UIButton the user can tap, once pressed the widget adds a notification to the app, if the button is pressed again the notification will be deleted.
Initially I added a sound to the touch of the button and worked ok with AVPlayer, then I decided to use the haptic engine to give feedback to the user so I deleted the AVPlayer call to stop the sound: guess what? the button continues to play the sound! I've commented the code I used to play the sound, how can it still play the sound?.
The strange thing is that one button has got this strange behaviour, while the other just works fine (only haptic engine), it sounds like a bug but I'm a rookie and it should be my fault somewhere.
Any idea?

How to release the sound in iOS when using SuperPowered library?

We are using SuperPowered library in our iOS app written in Swift and we encountered the problem that the sound is not released by the library and we can not find any way of fixing this.
The problem occurs when entering the view that instantiates the SuperPowered object and playing sound. This is the only place in the app that sound should be claimed. If the user is somewhere else in the app the sound should be released. The problem is that if we navigate to another place in the app and put our app in background and open another app like Spotify (that supports music in background), when switching back to our app the sound (from Spotify) will stop. The problem here is that SuperPowered library doesn't release the sound. Since our app is not a pure music app we do not want to stop other apps from playing sound while our app is in foreground (only when the user is in that view that is supposed to play sound as mentioned above).

Cordova - 'AVAudioSessionDelegateMediaPlayerOnly end interruption' error after pausing and resuming an app

This issue has arose using Cordova to play videos within an iOS application. I had thought to use the pause/resume feature to interact with the HTML5 video. However even when the video has stopped playing and the element has been set to display:none, or faded out etc, this error still appears in the console after the app is resumed - which then renders all video playing useless after it.
MP AVAudioSessionDelegateMediaPlayerOnly end interruption. Interruptor
<________-1874> category <(null)> resumable <0>, _state = 1
I have found issues relating to this, but are answered using C Objective for native app building.. and because I am using Cordova to build they do not apply unfortunately.
Has anyone else playing videos within PhoneGap/Cordova/Chrome Apps come across this and can offer a solution? Or anyone coding Native iOS apps could offer some advice as to why it is happening?
So to fix this (for anyone who may come across this in the future!), i had to resort to a bit of a hacky method.
When the Cordova iOS app is pushed to the background, and resumed, it looks as though any running video tags were unable to continue load and play video - the error above pops up in Xcode console and the video element is black no matter what. (I was fading still images on top of a video tag, then loading a new video using data attributes after a hotspot on the image is pressed). So when the app is paused I had to use JS/jQuery to remove and on resume it re-creates the video element and used the last selected data attributes to pick up the info from where it left off..
Seems to work, and is surprisngly seamless! :)

Programmatically refresh screenshot in iOS7 multitasking screen?

I have a music player app which implements background audio. I’m trying to update the screenshot in the iOS7 multi-tasking switcher when the track changes. So, if I background the app during Song A, it finishes and Song B comes on, if I then go into the tray I’d like to see a screenshot showing Song B’s artwork, title, etc.
I’ve done some digging and not managed to find any way to tell iOS to update short of implementing Background Fetch and going all out with that. Is there another means of doing this, something I can call to tell it to refresh it when my tracks change?
Apple does not provide any means of doing this. Even iOS own media player does not have this ability.

application is crashing while user exits from fullscreen mode in mpmovieplayer

hi folks we do have a video file in our application,every thing is going fine except one,i.e the application crashes when user exits from fullscreen mode while the movie is playing and also when we pause the movie in fullscreen mode and minimize it,the video starts from the beginning i tried searching whether there is any notification available to notify but of no use plz help me out.thx in advance.
atlast after studying a lot about mpmovieplayer class refernece i could find the answer for my question which i had posted yesterday.The reason for that was i was not able to provide all the available notifications i need, now i had mentioned each and every notification for entering into full screen,exit the fullscfreen and also playbackfinished now its working fine.The only problem is when i press the toggle screen it maximizes perfectly and plays from the current playbacktime but that not the case when i minimize the screen the video plays from the begining.

Resources