Project: titanium
Issue TIMOB-17997: iOS: playing local file in AudioPlayer results in crash
Calling start() or play() on an AudioPlayer that has the url set to a local file results in a crash: {code} [DEBUG] : Application booted in 146.823049 ms [DEBUG] : -[__NSCFDictionary close]: unrecognized selector sent to instance 0x14ebef40 [ERROR] : The application has crashed with an uncaught exception 'NSInvalidArgumentException'. [ERROR] : Reason: [ERROR] : -[__NSCFDictionary close]: unrecognized selector sent to instance 0x14ebef40 [ERROR] : Stack trace: [ERROR] : [ERROR] : 0 CoreFoundation 0x26068c1f + 126 [ERROR] : 1 libobjc.A.dylib 0x33870c8b objc_exception_throw + 38 [ERROR] : 2 CoreFoundation 0x2606e039 + 0 [ERROR] : 3 CoreFoundation 0x2606bf57 + 714 [ERROR] : 4 CoreFoundation 0x25f9ddf8 _CF_forwarding_prep_0 + 24 [ERROR] : 5 MediaModule 0x0022316b MediaModule + 1692011 [ERROR] : 6 Foundation 0x26d77b5b + 1118 [ERROR] : 7 libsystem_pthread.dylib 0x33f33e93 + 138 [ERROR] : 8 libsystem_pthread.dylib 0x33f33e07 _pthread_start + 118 [ERROR] : 9 libsystem_pthread.dylib 0x33f31b90 thread_start + 8 [ERROR] : *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary close]: unrecognized selector sent to instance 0x14ebef40' [ERROR] : *** First throw call stack: [ERROR] : (0x26068c1f 0x33870c8b 0x2606e039 0x2606bf57 0x25f9ddf8 0x22316b 0x26d77b5b 0x33f33e93 0x33f33e07 0x33f31b90) {code} *Steps to reproduce issue*: 1. Create a project with the attached files 2. Launch the app on an iOS device and click 'play' 3. Notice that the app crashes, occasionally with the above error *Expected results*: The local file is played properly or no crash is witnessed if the file/method is unsupported. *Notes*: snippet for reference: {code} var audioPlayer = Ti.Media.createAudioPlayer({	url : 'toddle.mp3' }); var but = Ti.UI.createButton({	title : 'Play',	top : 20, }); but.addEventListener('click', function(e) {	audioPlayer.start();	alert(" Playing !!"); }); {code}
Story points: 4