Issue
AudioPlayer error events implementation. If you try to get some errors about audio streaming and it's not possible. When the application tries to play a remote resource and the connection is off, an error is fired and the dialog message is showed. ("Unable to configure network stream").
Use case
I need get the error event about this error, but this is not implemented yet, i propose create an event for get all errors. (Ex. error event).
var streamer = Ti.Media.createAudioPlayer();
streamer.url = "http://54house.stream-balancer.de/";
//Another way to force the issue "Unable to configure network stream" by giving another file, not sound.
//streamer.url = "http://54house.stream-balancer.de/listen.pls";
streamer.addEventListener('change', function(e){
Ti.API.info( 'Change: '+ JSON.stringify(e) );
if(e.state == 0){
//back to initialized state
//Handle it!
}
});
streamer.start();
Probably iOS error property would allow to find out receiver's status so the error could be described (read-only property)
http://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVPlayer_Class/Reference/Reference.html#//apple_ref/occ/instp/AVPlayer/error
Edit: Added labels and moved to main project.
[Moved to description]
Issue cannot reproduce Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.4.0.GA IOS 7.1
[~shameerj] and [~sunila]. We should test this in 3.1.1 and 3.4.0 (latest master). * If it cannot be reproduced in 3.1.1, then mark as Can't Reproduce, with no fix version * If it can be reproduced in 3.1.1 but not in 3.4.0, mark as Fixed in 3.4.0 Reopening.
Issue reproduces on SDK version 3.1.1 Cannot reproduces on SDK version 3.4.0 Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.4.0.GA Titanium SDK version 3.1.1.GA iOS SDK: 7.1 iOS iPhone Simulator: 7.1
The console output [INFO] : Change: {"state":1,"description":"starting","bubbles":true,"type":"change","source":{},"cancelBubble":false} [INFO] : Change: {"state":2,"description":"waiting_for_data","bubbles":true,"type":"change","source":{},"cancelBubble":false} [INFO] : Change: {"state":3,"description":"waiting_for_queue","bubbles":true,"type":"change","source":{},"cancelBubble":false} [INFO] : Change: {"state":4,"description":"playing","bubbles":true,"type":"change","source":{},"cancelBubble":false} [INFO] : Change: {"state":5,"description":"buffering","bubbles":true,"type":"change","source":{},"cancelBubble":false} Environment tested: Mac osx 1-.9.4 Maverics Appcelerator Studio, build: 3.4.0.201408201526 Titanium SDK, build: 3.4.0.v20140824222513 Node.JS Version: v0.10.28 NPM Path: /usr/local/bin/npm NPM Version: 1.4.23 acs@1.0.16 alloy@1.5.0-dev (git://github.com/appcelerator/alloy.git#b2e8f580d023e45c63072df924666e58193a8981) install@0.1.7 npm@1.4.23 sudo@1.0.3 titanium@3.4.0-dev (git://github.com/appcelerator/titanium.git#9079326639c7f610dafee33dd16742de7d92d795) titanium-code-processor@1.1.1 Xcode6 Device: iPhone 5c iOS 7.1