Autoplay an Audio File on Mobile Safari - iphone

I've got a little system dashboard web app that I've written, replete with alarm notifications. I've had it working for quite some time on mobile safari, but recently wanted to add audio to the alarm notifications to allow me to easily know when there are alarms and I'm not looking directly at the display.
The alarm notifications are populated through a (relatively) constantly polling ajax request that pulls in and displays an alarm banner if alarms are present. I wanted to add an auto-playing 'alarm' sound as well, but no dice for Safari Mobile.
I've tried using HTML5 and embedded objects with no avail. The Apple documentation does state that you can't auto-play an audio file and it must be activated through user action to conserve bandwidth.
Has anyone found a way around this in a WLAN setting?

I guess that it's impossible, in fact, I hope so. Not for you, I'm sure that you'll use it for a good purpose, but I really don't want allow sites to auto-play audio files.
Oh, I remember something... It's possible with Flash!

Related

Flutter persistent notification and service

I'm planning to develop simple audio player, but currently I'm stuck on notification support. I want notification that is persistent while audio is playing and I also need some controls (like play/pause, next/previous) and possibly fanart visible on notification. That's similar as most other player do (Aimp, Google Play Music etc).
I was looking forward for good example how to develop it using Dart/Flutter, well is that even possible without writing native code for each platform (Android/iOS)? Is there any plugin that supports that kind of notification on both platforms? Plus, of course, foreground service bound to it to don't kill audio playback when screen is off.
You might be interested in looking at package:audio_service which seems like it might handle the majority of the work for you, including the handling of background execution and notifications.
Also, for notifications I've had success with package:flutter_local_notifications but you shouldn't need this if you're going to use package:audio_service.

how to control camera retake in ziggeo for Ionic 3 framework

How to control the camera retake in Ziggeo for Ionic3. Ziggeo is taking the user to the camera and according to the device option, their user can take a lot of retakes. is it possible to stop the camera retakes or user may reflect back to ionic app as soon as user take video (Stop recording button).
I tried to found this on Ziggeo documentation but didn't got succeed.
Let me first mention that I work at Ziggeo. Now with that being said, lets get cracking :)
When camera is requested on the desktop systems the browsers talk to OS and OS talks to the drivers. The drivers talk with the camera and provide the video data. On the mobile devices this is slightly different.
The mobile browser will ask the system, which will reply by activating the camera app. The camera app is different for different versions of system and system itself, however in general they refuse to listen for any parameters that are sent to them from browser.
This is why you might see the option to retake the recording on the mobile devices.
The purpose of Ziggeo is to however provide a way to use camera and mic in many ways. As such there is a way to actually skip the native app and go to a new way of recording videos.
This is accomplished by adding the webrtc_on_mobile parameter when you are creating your app.
var ziggeoApp = new ZiggeoApi.V2.Application({
token:"APPLICATION_TOKEN",
webrtc_streaming_if_necessary: true,
webrtc_on_mobile: true
});
Now the above is just the HTML version of it. The Ionic is a bit different. Currently it is not possible, however it will be possible in the next update.
Edit 2020:
To support iOS webrtc_streaming_if_necessary: true was created. This is because the WebRTC implementation of WebRTC on those systems is for streaming, not the standard WebRTC. By using it, you make sure that you are not using the WebRTC Streaming unless it is actually necessary to do so.
Added the way you would use it in the above code.
You can always check and find the latest on the header building page on Ziggeo here: https://ziggeo.com/docs/sdks/javascript/browser-integration/header

Open an application from a background app in iOS?

I have an application that runs in the background, I need it to pseudo randomly take a picture using the forward facing camera and send that to a database.
A possible solution I thought of was to use URL schemes to open another application, which will take the picture and send it, then use another URL scheme to open the background application back up. Does anyone know if this is possible?
Or perhaps there is a better solution.
It is not possible for an iOS application in the background to initialize, utilize, or grab photos from the camera hardware, let alone store or upload them to a local database.
Not only is this a security risk, but it poses a potential privacy invasion, and is just plain creepy. Besides, background apps only stay alive for 10 minutes or so, so even if this activity were possible, sustaining it would be impossible.
However, it is possible to use the camera directly from an active app without having to delegate the task to another application (perhaps you are thinking a little too much like an Android developer :p). Take a look at UIImagePickerController.
There's a very limited set of actions background applications can do—GPS, audio, phone & VOIP calls, and a couple of others. Accessing the camera is not one of those allowed actions, so you can't take a picture in the background.
As an alternative, you could set up a notification system to alert the user that it's time to take a picture (for whatever reason), and if they choose to open the app it could do your required actions then.

Create voice recognition app

I need to develop an App witch detects voice when it´s running (not what are they saying, just if someone speaks) and if so, I need to launch an especific mp3 from my sd.
I never developed for android/iphone but I need to especify my boss in how many hours it could be done.
Is there any easy way for voice recognition? and... I think that the answear could be yes but, is ther a way to listen a specified mp3 from my code?
(no plataform specified yet, it could be android or iphone)
Thanks very much in advance
Try looking at this question. It might help a bit. if you got back something valid from the google servers, then you could cause it play an MP3, I suppose.
EDIT: Also, it's important to remember that android phones don't do the "voice recognizing" themselves. The sound is streamed to Google servers (like a phone call) and the servers "recognize" what you're saying, and send that back to the phone.

How to create a "return to app" status bar when app goes to the background?

When my app moves to the background while either playing audio or recording audio, I would like to provide something like the the green "In Call" status bar that appears when you are in a call and swap out to another app, giving you a quick "return to app" capability.
I thought this might be a private API, but I noticed the Griffin iTalk app does this when it is recording audio (see picture) - so I know it can be done, but I have not been able to figure out what the API is (the Info.plist setting, the AVAudioSession, the UIApplication/Delegate or the whatever) to make this magic happen. My app is currently working and recording audio in the background and works just fine, I assume there is some bit somewhere I'm not setting to get this behavior.
Can someone either point me to the right docs or sample code that exhibits this behavior? (I've scoured the Audio docs and haven't been able to find it).
Thanks!
There may be a private API to do this, but if you want to get into the App Store, the thing to do is to register as a VOIP app, which gets you the in-call status bar, like Skype or (I imagine) iTalk.
Actually the red-bar actually only appears when the application is recording audio in the background. I've only ever done this when marking the application VOIP and Audio.
You may be able to do this by only marking is as background Audio application only, but I haven't tried this.