Highlighted

Background Audio

New Here ,
Oct 17, 2015

Copy link to clipboard

Copied

Hi,

I'm using Flex 4.6.0 / AIR 18.0 for creating a radio app for independent radio stations. Therefore, the feature of continuing playback of an mp3 stream when deactivating the app is a must. This can be achieved by the following settings (not a single thing can be different, otherwise playback just fades out when the app is deactivated/suspended):

application.xml:

  1. <key>UIBackgroundModes</key><array><string>audio</string></array>

Main.as:

  1. NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
  2. NativeApplication.nativeApplication.executeInBackground = true;
  3. SoundMixer.audioPlaybackMode = AudioPlaybackMode.MEDIA;

MyStreamPlayer.as:

  • Sound() object
  • SoundTransform() object
  • URLRequest() object
  • (If somebody needs a code snippet, let me know.)

When playing back the stream (no matter if the app is in background or active) and a call comes in, the stream is paused/silenced during that time. Exactly how it has to be.

The only weird thing about the behaviour is that when I leave the app (that continues playback) and, for example, go to iTunes and play a track, the iTunes track is played simultaneously to / over my my app's mp3 stream. My problem is that I don't know whether Apple is gonna reject my app because of this.. Because with other (I guess native) radio apps, this is not the case. Their stream stops when playing a track in iTunes after deactivating the radio app, and I have no clue how to achieve this because as I said in the beginning, the settings have to be exactly as mentioned above so playback doesn't stop when entering the background.

Can anybody help? Thanks!

TOPICS
Development

Views

470

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Background Audio

New Here ,
Oct 17, 2015

Copy link to clipboard

Copied

Hi,

I'm using Flex 4.6.0 / AIR 18.0 for creating a radio app for independent radio stations. Therefore, the feature of continuing playback of an mp3 stream when deactivating the app is a must. This can be achieved by the following settings (not a single thing can be different, otherwise playback just fades out when the app is deactivated/suspended):

application.xml:

  1. <key>UIBackgroundModes</key><array><string>audio</string></array>

Main.as:

  1. NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
  2. NativeApplication.nativeApplication.executeInBackground = true;
  3. SoundMixer.audioPlaybackMode = AudioPlaybackMode.MEDIA;

MyStreamPlayer.as:

  • Sound() object
  • SoundTransform() object
  • URLRequest() object
  • (If somebody needs a code snippet, let me know.)

When playing back the stream (no matter if the app is in background or active) and a call comes in, the stream is paused/silenced during that time. Exactly how it has to be.

The only weird thing about the behaviour is that when I leave the app (that continues playback) and, for example, go to iTunes and play a track, the iTunes track is played simultaneously to / over my my app's mp3 stream. My problem is that I don't know whether Apple is gonna reject my app because of this.. Because with other (I guess native) radio apps, this is not the case. Their stream stops when playing a track in iTunes after deactivating the radio app, and I have no clue how to achieve this because as I said in the beginning, the settings have to be exactly as mentioned above so playback doesn't stop when entering the background.

Can anybody help? Thanks!

TOPICS
Development

Views

471

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 17, 2015 0
New Here ,
Oct 29, 2015

Copy link to clipboard

Copied

Wow, thanks Adobe for your support. /sarcasm off

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 29, 2015 0
Anki_AG_ LATEST
Adobe Employee ,
Oct 29, 2015

Copy link to clipboard

Copied

Thanks for reporting the issue. We are looking into it.

Thanks,

Adobe Air Team

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 29, 2015 0