Xcode UIWebview background audio [duplicate] - ios

This question already has answers here:
UIWebView: HTML5 audio pauses in iOS 6 when app enters background
(4 answers)
Closed 9 years ago.
I have a simple iPhone App that uses UIWebView to show a mobile site that I have that allows users to create a playlist and listen to it online. Since I am not familiar with IOS development I thought that if I created an app with UIWebview and embedding my site on there it would work. And it does work perfectly, but when the app is in background mode, it stops playing the music.
How can I make it keep playing in background mode, even when iphone is locked. Also to make it play when iPhone is muted. I have found other topics on this but I have never created an app before and I am just working on this one simple UIWebview app.
If some one can please tell me exactly on what file I need to add the code and in what part of the file.
Please not that in the App Info I already enables the audio in background for the background modes. But it still does not work.
Thank you

Please this below links. I think this will help you..
Continue playing audio from html5 player when in iOS background mode
UIWebView: HTML5 audio pauses in iOS 6 when app enters background
http://www.dforge.net/2013/02/18/uiwebview-muted-sound-in-ios6/

Related

iOS PWA Background Audio Support [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 months ago.
Improve this question
While playing audio in Safari on iOS, it is possible to minimise Safari or lock the screen and the audio continues to play. However, if the site is installed to the HomeScreen as a PWA, minimising the PWA or locking the screen pauses the audio.
Is there any way to make playback continue in the background when in the iOS PWA?
The problem is described in detail here:
https://medium.com/prototyped/what-we-learned-about-pwas-and-audio-playback-10a01c6aecbd
It seems to have been a bug fixed in iOS 15.4
https://twitter.com/othermaciej/status/1491500338305667072
I just tried it and it appears to work fine!
As partial workaround for iOS - you can use this setting in manifest
"display": "minimal-ui"
When user click pwa app icon on home screen the Safari is opened, as result pwa is opened like web-site with address bar in Safari and playback in the background is working
This is the best way to not stop playing audio files on iPhones
Using this plugin you can play audio files in the background
Prevent display sleep and enable wake lock in all Android and iOS web browsers.
NoSleep.js

Background audio not work with Ionic3 + Videogular2 on iOS

I'm using Videogular2 in an Angular/Cordova/Ionic3 project, where I play mp3 audio live streams. All works good with mp3 and mp4, on browser and iOS simulator.
When the user Lock The Screen in iOS Device I expect that the audio continues to play in a background mode, but on IOS when the user Lock The Screen audio stop to play.
I've tested on XCODE 8 to set 'Capabilities' tab adding 'audio' parameter, I've added cordova-plugin-backgroundaudio to the project without success.
On iOS Simulator it works well, the problem occurs only on iOS Device.
Tested on iPhone 6 & iPad 3.
I'm using:
iOS 10.3.3
XCODE 8.3.3
Ionic 3.12.1
Videogular2 5.4.11
No one else used videogular2 on cordova/ionic?
In iOS app audio won't be playing in background when the device is locked. For that you have to enable the background mode for the app. I had faced the same issue in one of my application (I was using different audio plugin).
In order to enable background mode in iOS you can use below plugin
https://ionicframework.com/docs/native/background-mode/. When you start playing the audio you just need to call backgroundMode.enable() to keep it playing in background. When you leave the audio player page if want you can disable background mode to avoid unnecessarily keeping the background mode on by calling backgroundMode.disable().
Additionally you need to enable the background audio feature in xcode project settings as shown in below link.
https://koenig-media.raywenderlich.com/uploads/2016/09/BM-EnableAudioInBG.png

Cordova 3.5 iOS 8 Media Recording

I am using the ionic framework to record audio using the Media object. It was working fine but with recent iOS updates now after recording something and releasing the Media object, the sound is disabled in my app until I crash it. No sound will play form any other part of the app and the + - volume controls on the side of the phone produce no volume overlay. I don't understand enough about iOS to know what's going on.
Any help is appreciated.

Qt Quick iOS: How to keep audio playing while app is in background

I’m developing a WebRadio application in qml for iOS devices with Qt 5.2. To play the audio stream I use the MediaPlayer type which works fine.
However, in iOS, when I switch to another application or go back to home (in other words when the app go to background) the sound stops, but I want it to continue playing.
I know how to do it in objective-C by activating the AVAudioSession and add the audio background mode the info.plist file.
But I really don't know how to do it in qml.
Can someone help ?
You can add the audio background mode to the info.plist file or via the capabilities tab in Xcode.

How to run the iOS App when screen is locked [duplicate]

This question already has an answer here:
Background downloading even if the phone gets locked
(1 answer)
Closed 8 years ago.
I am downloading some files from server using NSURLConnection. It works fine when app is in foreground or background. App is not running when iPhone Screen is locked.
My client want the App to run in locked mode also. Is there any way to download the data when screen is locked.
you can not test application when device is locked
check this apple doc
Your app will be rejected by Apple if you turn app on screen locked.
Refer to these links which answered already:
GameKit keeping connection going while device screen off or in background
Running IOS App with Screen Locked

Resources