Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2586] Android: AudioPlayer.setUrl causes exception

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:59:31.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M01
ComponentsAndroid
Labelsandroid, defect, release-1.6.0
ReporterBill Dawson
AssigneeBill Dawson
Created2011-04-15T03:23:38.000+0000
Updated2011-04-17T01:59:31.000+0000

Description

Our http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Media.AudioPlayer-object.html"> docs say that the way you set the Audio Player's url is with .setUrl. This causes an exception in Android (though it is possible to set the .url property instead).

Failcase:

var player = Ti.Media.createAudioPlayer();
player.setUrl('x');

will cause an exception which you can see in logcat (trace log):

E/KrollContext(  456): org.mozilla.javascript.EcmaError: TypeError: Cannot find function setUrl in object [Ti.Media.AudioPlayer]. (app://app.js#10)
E/KrollContext(  456):  at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3761)
E/KrollContext(  456):  at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3739)
E/KrollContext(  456):  at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3767)
E/KrollContext(  456):  at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3786)
E/KrollContext(  456):  at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3850)
E/KrollContext(  456):  at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2343)
E/KrollContext(  456):  at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2310)
E/KrollContext(  456):  at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1524)
E/KrollContext(  456):  at script(app://app.js:10)

Comments

  1. Bill Dawson 2011-04-15

    (from [f56e13c4273318e5515db7de0d4b59be4463e155]) [#2586 state:fixed-in-qa] Add kroll.method annotation to AudioPlayerProxy.setUrl, drillbit test for it. https://github.com/appcelerator/titanium_mobile/commit/f56e13c4273318e5515db7de0d4b59be4463e155"> https://github.com/appcelerator/titanium_mobile/commit/f56e13c42733...

  2. Thomas Huelbert 2011-04-15

    [INFO] Titanium SDK version: 1.6.0 (01/04/11 08:01 e49700d), no exception using provided code snippet, emulator or 1.6 device

JSON Source