Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14541] iOS: AudioPlayer throws error with no internet connection when attempting to play a remote resource

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2014-08-20T04:38:25.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.4.0
ComponentsiOS
Labelsapi, audio, ios, module_media, qe-manualtest
ReporterFábio Ribeiro
AssigneeIngo Muschenetz
Created2013-06-29T19:58:02.000+0000
Updated2014-08-25T20:35:47.000+0000

Description

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

Comments

  1. Eduardo Gomez 2013-07-10

    Edit: Added labels and moved to main project.
  2. Fábio Ribeiro 2013-07-11

    [Moved to description]
  3. Shameer Jan 2014-08-07

    Issue cannot reproduce Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.4.0.GA IOS 7.1
  4. Ingo Muschenetz 2014-08-13

    [~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.
  5. Shameer Jan 2014-08-20

    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
  6. Olga Romero 2014-08-25

    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

JSON Source