Blocking default player to play audio files ios - ios

My App has functionality to record and play audio using AVAudioRecorder/AVAudioPlayer respectively. Whenever I download an audio file from the server, the file is opened automatically using the default player with a black screen as shown:
However, I actually have my own user interface to play audio files. How can I block this option programmatically?

Related

iOS Cordova Media Plugin in background: MEDIA_ERR_NONE_SUPPORTED = 4

When running my app in background, I would get MediaError.MEDIA_ERR_NONE_SUPPORTED (4) when trying to create and play an audio file.
While most suggestions for this error relates to file format, file existence or audio recording, my audio files were playing perfectly when the app was in foreground.
Note: I am already using the Cordova Background Mode plugin.
It turns out that the Cordova Music Controls is causing this interference.
Without manipulating the music controls, audio plays perfectly even when the app enters background.
The problem came from destroying the music controls, which makes iOS prevent your app from playing audio until the user resumes the app to foreground.
Turns out you don't have to destroy music controls before creating them again, to update the track label.
TLDR; Don't kill music controls while playing audio in the background.

How can I play music successively in the background with UIWebView or WKWebView

The website implemented inside my app would play a series of mp3 files,it works well when the app is active,but when I press HOME button or lock the phone,it cannont play more than ONE song in the background,after that,app suspended.
I've already tried to set different kind of AVAudioSession Category,but of no use.
I assume you don't have audio background mode enabled. This is what Apple documentation says:
When the UIBackgroundModes key contains the audio value, the system’s media frameworks automatically prevent the corresponding app from being suspended when it moves to the background. As long as it is playing audio or video content or recording audio content, the app continues to run in the background. However, if recording or playback stops, the system suspends the app.
So it seems like you just need to enable audio background mode. Here is Ray Wenderlich's tutorial on background modes

AVPlayer stops loading tracks in lock screen

I was developing an app in which I'm receiving audio files from airdrop in inbox folder of the app and playing them with AVPlayer. I have turned on the background mode for audio playback. But when I lock the iPhone and current music file ends, next file doesn't load from inbox folder. But I also have audio in main Document folder, there everything is working fine.
Any help in this?

PhoneGap/Cordova html5 audio (jPlayer) album art on Lock Screen

I have a HTML5 Application for audio playing. It uses jPlayer for playing the audio on html5. When I bundle it within phonegap, iOS is itself fetches the audio stream and shows its navigation icons on the lock screen. Now I want to push a image to that lock screen notification. I have followed this link
How to set informations of current song to iPhone lock screen with JS
https://github.com/ChoiZ/NowPlaying/tree/phonegap2
Is there any plugin available for this.
I dont want to create a new media object with audio src but just want to pass image to the current lockscreen song.

How to continue playing a youtube video at background when switch from my app back to home screen

Seems the default action for iOS 6 is to stop the video from playing after I switch to HOME screen. Then if I want to listen to the audio I have to go back to the app and press the 'Play' button again. I am using youtube API.
How can I continue playing the video when the application is in UIApplicationStateInactive and UIApplicationStateBackground. I just want to be able to listen to the audio even if I am on HOME screen or the screen is locked. Should I use a background thread or restart playing the video at the previous position as it was before turning the app inactive?
Take a look at the app 'Jasmine'. They managed to do something similar to what you are seeking. However, UIApplicationStateInactive/UIApplicationStateBackground will cause the video to pause. Double tapping the home button and then pressing the audio play button will cause the video's audio to resume without keeping the app active.
Take a look at the new iOS 7. You may have some luck there.
Inter-App Audio
Now your apps can make beautiful music together. With Inter-App Audio,
apps can register their audio streams to share with other apps. For
example, a series of apps could publish audio streams of instrument
tracks while another uses the combination of these streams to compose
a song. Inter-App Audio also provides for MIDI control of audio
rendering, remotely launching other registered Inter-App Audio apps
and more.

Resources