Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11200] Android: Can't play an audio file from the applicationDataDirectory in android 2.x but it works in android 4.x

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-08-13T23:34:04.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 12 API, 2013 Sprint 12, Release 3.2.0
ComponentsAndroid
Labelsexalture, module_media, qe-manualtest
ReporterNikhil Sharma
AssigneeSunila
Created2012-09-27T21:26:57.000+0000
Updated2014-08-13T23:34:04.000+0000

Description

Can't play an audio file from the applicationDataDirectory in android 2.x but it does work in android 4.x

Repo Steps

1. Run the attached app.js in your project. 2. Click the button "Play a cricket sound". 3. In android 2.x. it doesn't play but in android 4.x it works.

Attachments

FileDateSize
app.js2012-09-27T21:26:57.000+00001234

Comments

  1. Michael DeGiovanni 2012-11-27

    using ti 2.1.4 testing on xperia S (android 4.0) no sound is played: DDMS shows awesomeplayer: setDataSource_l('data/data/.mp3' awesomeplayer: unexpected abortprepare. notify listener of error than ti.sound : Issue while initialising
  2. Freddy Montano 2012-12-11

    I am having the exact same issue. Is there a workaround/suggestion for this?
  3. Shawn Lipscomb 2012-12-11

  4. Sunila 2013-06-08

    For 4.0 and below, MediaPlayer uses the native player which requires files to have worldreadable access, workaround is to open an input stream to the file and give that to the player. https://github.com/appcelerator/titanium_mobile/pull/4368
  5. Lokesh Choudhary 2013-10-23

    Verified the fix. We can play the audio file on a 2.X device. Thus closing. Environment: Appcel Studio : 3.2.0.201310230601 Ti SDK : 3.2.0.v20131022171645 Mac OSX : 10.8.5 CLI - 3.2.0 with hash 72f7426b4ee6c2d2883c666d5b7e03906a16012f Android device running : 2.X

JSON Source