Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7365] Android: Ti.Media.AudioPlayer.getUrl not exposed as method

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-04-06T10:38:21.000+0000
Affected Version/sn/a
Fix Version/sRelease 2.1.0, Sprint 2012-07
ComponentsAndroid
Labelscore, module_media, parity, qe-testadded
ReporterArthur Evans
AssigneeNeeraj Gupta
Created2012-01-24T16:25:43.000+0000
Updated2013-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))); }

Comments

  1. Arthur Evans 2012-03-28

    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.
  2. Chase Culpepper 2012-04-06

    To verify fix, run this code
       var audioPlayer = Ti.Media.createAudioPlayer({ 
           url: 'www.example.com/podcast.mp3',
           allowBackground: true
       });
       
       Ti.API.info('audioPlayer.getUrl() = '+audioPlayer.getUrl());
       
    The Console should show something to the effect of
       I/TiAPI   (  373): audioPlayer.getUrl() = file:///android_asset/Resources/www.example.com/podcast.mp3
       
       
  3. Eric Merriman 2012-06-18

    Verified fixed with SDK 2.1.0.v20120618102300 on Droid
  4. Joe Falcone 2013-03-06

    Appears to be a regression in SDK 3.02 - I'm getting this on Android 4.04 Uncaught TypeError: Object# has no method 'getURL'
  5. Neeraj Gupta 2013-03-06

    @Joe - Do you have a test case to reproduce this issue?
  6. Arthur Evans 2013-03-06

    Joe, Note capitalization. The Ti method is "getUrl", not "getURL".
  7. Joe Falcone 2013-03-07

    Sorry, I stand corrected. It was confusing that it worked under iOS but not under Android.
  8. Arthur Evans 2013-03-07

    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.
  9. Shameer Jan 2013-12-10

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/5021

JSON Source