Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23428] Android: Ti.Media.Sound method 'setUrl' not working

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-12-15T08:54:27.000+0000
Affected Version/sRelease 5.2.2
Fix Version/sRelease 6.1.0
ComponentsAndroid
LabelsTi.Media.Sound, setUrl
ReporterCREATIVE KAIZEN
AssigneeMaggie Chen
Created2016-05-24T15:06:39.000+0000
Updated2017-01-03T22:17:19.000+0000

Description

Ti.Media.Sound method 'setUrl' is described in latest documentation.

Steps to reproduce

var sound = Ti.Media.createSound({
	url: '/sounds/sample.mp3'
});

sound.setUrl('/sounds/sample2.mp3');

sound.play();

Actual Result

[ERROR] : TypeError: Object # has no method 'setUrl' [ERROR] : File: app.js [ERROR] : Line: undefined [ERROR] : SourceId: undefined [ERROR] : Backtrace: [ERROR] : undefined Thanks

Comments

  1. Sharif AbuDarda 2016-05-24

    Hello, I was able to reproduce the issue. This is a valid bug in Android. For iOS this is working as expected.
       var sound = Ti.Media.createSound({});
       sound.setUrl('Sounds.mp3');
       sound.play();
       
    Environment
       Operating System
         Name                        = Mac OS X
         Version                     = 10.11.4
         Architecture                = 64bit
         # CPUs                      = 4
         Memory                      = 8589934592
       Node.js
         Node.js Version             = 4.2.2
         npm Version                 = 2.14.7
       Titanium CLI
         CLI Version                 = 5.0.6
       Titanium SDK
         SDK Version                 = 5.2.2.GA
         Target Platform             = android
       
  2. Sharif AbuDarda 2016-12-12

    This issue is still reproducible in SDK 6.0.0.GA. Tested in Android 6.0.1 device.
  3. Maggie Chen 2016-12-15

    PR: https://github.com/appcelerator/titanium_mobile/pull/8690
  4. Abir Mukherjee 2017-01-03

    Validated with this environment: NPM Version: 2.15.9 Node Version: 4.5.0 Mac OS: 10.12.1 Appc CLI: 6.1.0 Appc CLI NPM: 4.2.8 Titanium SDK version: 6.1.0.v20170103080657 Appcelerator Studio, build: 4.8.1.201612050850 Xcode 8.2 Android Device: 6.0.1 I first reproduced the issue using SDK 6.0.1 GA. The sound file did not play, and errors were printed on the console. I then tried it (on Android Device) with SDK 6.1.0, and was able to play a sound file as expected, and no errors were printed.

JSON Source