Skip to main content
Participant
February 13, 2012
Answered

ios application sound issue

  • February 13, 2012
  • 2 replies
  • 658 views

Hello,

My question is related with ios application sound player icon located in top bar, near to battery icon. it appears when user listens music through some applications like ipod, soundCloud, youtube and etc.

With the tests I have made, I have seen that AIR does not make this when you create a sound object and play it. Is it possible to make the air application as default player in ios?

icon picture is here (blue arrow at the top bar)

http://a5.mzstatic.com/us/r1000/090/Purple/8a/21/cb/mzl.anbzmref.320x480-75.jpg

thank you.

This topic has been closed for replies.
Correct answer supertosbaa

I have solved the issue by using htmlwebview.

This is javascript. //radio.html

var audio = new Audio();

audio.setAttribute('src', 'http://xxx.xx.xxx.xxx:9001/;stream/1');

  function playRadio()

          {

                    audio.play();

          }

          function stopRadio()

          {

                    audio.pause();

          }

and actionscript side

_html = new StageWebView();

                                        _html.viewPort = new Rectangle(0, 0, 0, 0);

                                        _html.stage = stage;

                                        _html.addEventListener(Event.COMPLETE, onHTMLLoadComplete, false, 0, true);

                                        var buildPath:String = File.applicationDirectory.nativePath;

                                        var source:String;

                                        source = buildPath+"/radio.html";

                                        _html.loadURL(source);

                                        function onHTMLLoadComplete(event:Event):void

                                        {

    _html.loadURL("javascript:playRadio()");

                                        }

2 replies

supertosbaaAuthorCorrect answer
Participant
March 4, 2012

I have solved the issue by using htmlwebview.

This is javascript. //radio.html

var audio = new Audio();

audio.setAttribute('src', 'http://xxx.xx.xxx.xxx:9001/;stream/1');

  function playRadio()

          {

                    audio.play();

          }

          function stopRadio()

          {

                    audio.pause();

          }

and actionscript side

_html = new StageWebView();

                                        _html.viewPort = new Rectangle(0, 0, 0, 0);

                                        _html.stage = stage;

                                        _html.addEventListener(Event.COMPLETE, onHTMLLoadComplete, false, 0, true);

                                        var buildPath:String = File.applicationDirectory.nativePath;

                                        var source:String;

                                        source = buildPath+"/radio.html";

                                        _html.loadURL(source);

                                        function onHTMLLoadComplete(event:Event):void

                                        {

    _html.loadURL("javascript:playRadio()");

                                        }

User Unknow
Legend
February 13, 2012

Yes, but I think you need develop ANE native extension for this