Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23258] Android: Ti.Media.AudioPlayer: Support "audioSessionId"

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2016-05-06T17:36:45.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsAndroid
Labelsn/a
ReporterRainer Schleevoigt
AssigneeAngel Petkov
Created2016-04-21T16:37:57.000+0000
Updated2016-05-26T22:28:28.000+0000

Description

Hi, for using of 'Ti.AudioVisualizerView' we need the audioSessionId from Mediaplayer instance. It is a read only property and we need only this method 'getAudioSessionId()'. Code strong!

Comments

  1. Sharif AbuDarda 2016-04-21

    Hello, Thanks for submitting the feature request. Shouldn't it be "Ti.Media.getAudioSessionId()" instead of "Ti.Media.AudioPlayer.getAudioSessionId()"? Our engineers will look into it. Moving the ticket. Regards, Sharif.
  2. Hans Knöchel 2016-04-24

    [~sdarda] No, the property (and its generated read-only getter) should be part of the (existing) [Ti.Media.AudioPlayer](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media.AudioPlayer) proxy.
  3. Rainer Schleevoigt 2016-04-28

    @Hans. Exactly. It is a simple getter. With this ID the user can use postprocesses like visualizer or equalizer.
  4. Rainer Schleevoigt 2016-04-28

    I don't know how PR (what I have to fork?) Here the diffs:
       //   …/media/TiSound.java#191
       public int  getAudioSessionId() {
       	if (mp != null) {
       		return mp.getAudioSessionId();
       	}
       	return 0;
       }
       
    and in AudioPlayerProxy
        //  …/media/AudioPlayerProxy.java#172:
       @Kroll.method
       public int getAudioSessionId() {
       	TiSound s = getSound();
       	if (s != null) {
       		return s.audioSessioniD();
       	}
       	return 0;
       }
       
  5. Angel Petkov 2016-05-05

    [~titanium@webmasterei-hamburg.de] Hello, thanks you for the contribution and I apologies for the delay on the ticket. I've pushed these changes as a community PR, one of our android developers will review the commits and merge them. As for what to fork if you look at the SDK [repo](https://github.com/appcelerator/titanium_mobile) there is instructions on how to contribute, long story short you just need to fork the repo ,add a remote to the appcelerator repo, then push your changes to your repo and create a pull-request to the appcelerator repo. Looking forward to your future contributions!
  6. Ashraf Abu 2016-05-06

    PR from [~apetkov] https://github.com/appcelerator/titanium_mobile/pull/7989
  7. Ashraf Abu 2016-05-06

    [~apetkov] I have reviewed it, please take a look at my comments in the PR. Thank you.
  8. Lokesh Choudhary 2016-05-26

    Verified the fix. audioSessionId is now supported by Ti.Media.AudioPlayer. We get a audioSessionId when the audio Player is playing audio. Closing. Environment: Appc Studio : 4.6.0.201605180604 Ti SDK : 5.4.0.v20160526011354 Ti CLI : 5.0.8 Alloy : 1.8.7 MAC El Capitan : 10.11.4 Appc NPM : 4.2.5-5 Appc CLI : 5.3.0-47 Node: 4.2.2 Nexus 6 - Android 6.0.0

JSON Source