Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23796] TiMediaAudioPlayer colaborates with MediaSession

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2016-08-21T22:39:54.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, mediasession
ReporterRainer Schleevoigt
AssigneeChee Kiat Ng
Created2016-08-10T10:50:20.000+0000
Updated2016-08-22T07:17:56.000+0000

Description

Hi, for controlling the AudioPlayer from Notification it makes sense to use the NotificationCompat.MediaStyle. This need a reference to MediaPlayer (aka MediaSession) Here an example code for it:
Notification noti = new NotificationCompat.Builder()
     .setSmallIcon(R.drawable.ic_stat_player)
     .setContentTitle("Track title")
     .setContentText("Artist - Album")
     .setLargeIcon(albumArtBitmap))
     .setStyle(new NotificationCompat.MediaStyle()
         .setMediaSession(mySession))
     .build();
 )
`` Is it possible to add a method getMediaSessionId()` to AudioPlayer? Or is it the same as audioSessionId? Code Strong! Rainer

Comments

  1. Sharif AbuDarda 2016-08-10

    Hello, Can you provide a sample test case so we can test the issue. Thanks.
  2. Hans Knöchel 2016-08-10

    This is a feature-request to incorporate with his native module. Please do a core-contribution to get this integrated, thanks!
  3. Hans Knöchel 2016-08-21

    After some quick investigations and [this page](http://www.codota.com/android/scenarios/52fcbcdada0a1f9f8d94c0b5/android.media.MediaPlayer?tag=dragonfly), I found out that it is just an alias for the already existing method that is exposed as ¢getAudioSessionId|http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media.AudioPlayer-method-getAudioSessionId] as you already suggested. Closing.
  4. Rainer Schleevoigt 2016-08-22

    Hi Hans, if AudoSession same as MediaSession, then the ticket is closed. In my thought AudioSession = binding to PCM data and MediaSession is for binding to controlling. I have no tested if it the same, sorry.

JSON Source