AIR 2.7 for iOS playing audio in the background?

Update

With the latest version of Adobe AIR 3 Beta, Adobe has added this functionality to its SDK.

http://labs.adobe.com/technologies/flashplatformruntimes/air3/

Support for playing iOS audio files . Developers can now write multi-tasking iOS applications that can play audio in the background, including music or voice chat from a conferencing application.

--------- Original post ---------

With the new version of AIR SDK 2.7 and Flash Builder 4.5.1, you can "Use new features in iOS 4, for example, multitasking ..." (from http://www.adobe.com/products/air/features/ )

Search a bit I found out that this "multitasking" does not include a real background process, for example, playing sound when the application is in the background!

I know this is new, but does anyone know if sound can be played in the background?

+4
source share
3 answers

With Air 3.0, you can have background music thanks to the UIBackgroundModes UIKit keys (http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html):

Just modify the / src / -app.xml file as follows:

<?xml version="1.0" encoding="utf-8" standalone="no"?> <application xmlns="http://ns.adobe.com/air/application/3.0"> <!-- changed from 2.7 to 3.0 --> ... <iPhone> <InfoAdditions><![CDATA[ <key>UIDeviceFamily</key> <array> <string>1</string> <!-- app will run on IPhone --> <string>2</string> <!-- app will run on IPad --> </array> <key>UIBackgroundModes</key> <array> <string>audio</string> <!-- audio background mode key --> </array> ]]></InfoAdditions> <requestedDisplayResolution>high</requestedDisplayResolution> </iPhone> </application> 

Successfully tested on iPhone 4 and iPad 1.

Of course, you must have an Air 3 SDK to use this feature. Air 3 comes with FB 4.6.

If you are using FB 4.5, the Air Flash SDK must be installed manually in Flash Builder 4.5. Installation Procedure:

1. Find the "old" SDK

They are located in the Flash Builder directory, in my case they were c: \ program (x86) \ adobe \ flash builder 4.5 \ sdks

2. Make a copy of the previous SDK

Copy the previous SDK (I used SDK 4.5.1 for this) and renamed the copied folder to AIR3SDK (or another name if you want)

3. Overwrite the copied (!) SDK using the AIR3 SDK

Copy all files from the AIR3 SDK to the copied folder. He should ask you to overwrite the files a couple of times. After that, you should have the AIR3 SDK work package installed.

4. Name the new SDK

I had to do this with Beta2 - go to the new SDK directory and edit the flex-sdk-description.xml file - change the contents from Flex 4.5.1 to the AIR3 SDK.

5. Add new playerglobal.swc from Flash Player 11

Download the current Flash Player 11 "playerglobal.swc" from http://labs.adobe.com/downloads/flashplayer11.html and place it in the desired folder. From the root folder of the SDK, it was: /frameworks/libs/player/11.0/ (I had to create the 11.0 folder myself, and then just put the file there and rename it to the usual "playerglobal.swc")

6. Add the AIR3 SDK to Flash Builder

In the "Project Settings - Flex Compiler" section for the project, select the new SDK as the SDK to use in the project. If the SDK does not appear, go to "Configuring the Flex SDK", then "Add" and select the newly created folder. The new AIR3 SDK should now be included in the drop-down list as a compiler for this project.

Remember to add -swf-version = 13 as the compiler flag on the same screen.

Having done all this, I was able to use new functions, compile my projects and work well with it

Air 3 SDK procedure source: http://forums.adobe.com/thread/899921

+4
source

I understand that the text you quoted there simply indicates the possibility of freezing and freezing the application, since iOS users control other applications, which allows you to return to the previous view / state when the user returns to the application and nothing else.

I do not think that even if you specify a UIBackgroundMode sound, your audio will play in the background using AIR 2.7. Later versions, I think, will come with this functionality.

0
source

These are the keys of the iOS phone that will be described in the XML application. Most of them are not available in AIR 2.7.

In any case, we must admit that the work was done by Adobe. Incredibly productive workflow for the workflow of developing mobile applications for mobile phones and the desktop.

Currently supported iOS keys in AIR 2.7. The one we need for audio is UIBackgroundModes "audio"

0
source

All Articles