[TIMOB-24082] Ti.Media.soundPlayer is not working on Android KitKat (4.4)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-12-05T18:24:58.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.0 |
Components | Android |
Labels | n/a |
Reporter | Mostafizur Rahman |
Assignee | Frankie Merzadyan |
Created | 2016-10-28T19:40:04.000+0000 |
Updated | 2017-01-17T18:52:09.000+0000 |
Description
Hello,
Ti.Media.soundPlayer is not working on Android KitKat (4.4). The sound is not playing. Although its working fine on android 5.1.1.
*Testing Environment:*
Operating System
Name = Mac OS X
Version = 10.11.3
Architecture = 64bit
# CPUs = 4
Memory = 4294967296
Node.js
Node.js Version = 4.6.0
npm Version = 2.15.9
Titanium CLI
CLI Version = 5.0.9
Titanium SDK
SDK Version = 5.5.1.GA
SDK Path = /Users/GSLMAC3/Library/Application Support/Titanium/mobilesdk/osx/3.2.1.GA/mobilesdk/osx/5.5.1.GA
Android devices: Samsung Galxy tab 3 v 4.4.2, Samsung Galaxy Grand Prime (5.1.1)
*Test Code:*
app.js
var win = Titanium.UI.createWindow({
title:'Audio Test',
backgroundColor:'#fff',
layout: 'vertical'
});
var audioPlayer = Ti.Media.createSound({
url : 'whatsupdogs.wav',
allowBackground : true
});
audioPlayer.play();
win.open();
*Testing Result:*
Ti.Media.soundPlayer is not working on Android KitKat (4.4).
Attachments
File | Date | Size |
---|---|---|
whatsupdogs.wav | 2016-11-08T14:55:14.000+0000 | 51268 |
I cannot reproduce the problem. The WAV file I used played fine on my Android 4.4 emulator.
[~mrahman] Could you provide the audio file you are attempting to play? I believe it may not be encoded correctly.
PR: https://github.com/appcelerator/titanium_mobile/pull/8607 *Test case: (Android 4.4.2) you should not be getting this error in log output:* {noformat} (KrollRuntimeThread) [104,104] Error setting file descriptor: java.io.IOException: setDataSourceFD failed.: status=0x80000000 at android.media.MediaPlayer._setDataSource(Native Method) at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1277) at ti.modules.titanium.media.TiSound.initializeAndPlay(TiSound.java:107) at ti.modules.titanium.media.TiSound.play(TiSound.java:216) at ti.modules.titanium.media.SoundProxy.play(SoundProxy.java:155) at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:196) at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:319) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:146) at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118) {noformat}
master: https://github.com/appcelerator/titanium_mobile/pull/8657
Verified fixed; the provided sound file is able to be played on 4.4.4 devices and 4.4.2 devices. *Environement*