[TIMOB-7365] Android: Ti.Media.AudioPlayer.getUrl not exposed as method
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-04-06T10:38:21.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 2.1.0, Sprint 2012-07 |
Components | Android |
Labels | core, module_media, parity, qe-testadded |
Reporter | Arthur Evans |
Assignee | Neeraj Gupta |
Created | 2012-01-24T16:25:43.000+0000 |
Updated | 2013-12-10T06:06:49.000+0000 |
Description
Both getUrl, setUrl work on iOS, but only setUrl works on Android. I believe this is just a typo,
note missing @Kroll.method annotation:
@Kroll.getProperty
public String getUrl() {
return TiConvert.toString(getProperty(TiC.PROPERTY_URL));
}
@Kroll.setProperty @Kroll.method
public void setUrl(String url) {
if (url != null) {
setProperty(TiC.PROPERTY_URL, resolveUrl(null, TiConvert.toString(url)));
}
Please note that this issue is called out specifically in the APIDocs, AudioPlayer.yml, so when you fix this, please REMOVE the method doc for "getUrl" and "setUrl". These methods are only in the doc because the getUrl platforms: field doesn't match the one for the "url" property. With this anomaly removed, docgen can autogenerate the accessors for the property.
To verify fix, run this code
The Console should show something to the effect of
Verified fixed with SDK 2.1.0.v20120618102300 on Droid
Appears to be a regression in SDK 3.02 - I'm getting this on Android 4.04 Uncaught TypeError: Object#
@Joe - Do you have a test case to reproduce this issue?
Joe, Note capitalization. The Ti method is "getUrl", not "getURL".
Sorry, I stand corrected. It was confusing that it worked under iOS but not under Android.
That is confusing. Looking at the code, it appears that the way iOS maps getters & setters to properties ignores case. (so getUrL would probably work, too). This seems like a bug to me. I'll open a ticket.
Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/5021