Skip to content

Commit 31228a8

Browse files
committed
1.1.2
1 parent 63ef2d6 commit 31228a8

4 files changed

Lines changed: 11 additions & 8 deletions

File tree

android/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
titanium.platform=/Users/andrew/Library/Application Support/Titanium/mobilesdk/osx/5.0.2.GA/android
1+
titanium.platform=/Users/andrew/Library/Application Support/Titanium/mobilesdk/osx/5.2.2.GA/android
22
android.platform=/Developer/android-sdk/platforms/android-21
33
google.apis=/Developer/android-sdk/add-ons/addon-google_apis-google-21
3 Bytes
Binary file not shown.

android/manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# this is your module manifest and used by Titanium
33
# during compilation, packaging, distribution, etc.
44
#
5-
version: 1.1.1
5+
version: 1.1.2
66
apiversion: 2
77
architectures: armeabi armeabi-v7a x86
88
description: advancedaudioplayer

android/src/com/kcwdev/audio/MediaPlayerWrapper.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ protected void initialize()
138138
}
139139
}
140140

141-
setSpeakerphoneOn();
141+
setSpeakerphoneOn(); // Configures initial audio routing
142142

143143
mp.setLooping(looping);
144144
mp.setOnCompletionListener(this);
@@ -399,21 +399,24 @@ public void setTime(int position)
399399
}
400400

401401
/**
402-
* Sets the speaker mode. This can only be called once per instance of the player (i.e. when
403-
* it is initializing).
402+
* Sets the speaker mode for this MediaPlayer.
403+
* Must be called at the start; can only be declared once.
404404
*/
405405
public void setSpeakerphoneOn() {
406406
if (mp != null) {
407407

408-
speakerphone = true;
409-
if(proxy.hasProperty("speakerphone")) {
408+
speakerphone = true; // Default value is on
409+
410+
if(proxy.hasProperty("speakerphone"))
411+
{
412+
// See if we specified a custom property when calling the module
410413
speakerphone = TiConvert.toBoolean(proxy.getProperty("speakerphone"));
411414
}
412415

413416
if(speakerphone)
414417
{
415418
mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
416-
am.setMode(AudioManager.USE_DEFAULT_STREAM_TYPE);
419+
am.setMode(AudioManager.STREAM_MUSIC);
417420
am.setSpeakerphoneOn(true);
418421
}
419422

0 commit comments

Comments
 (0)