[TIMOB-23796] TiMediaAudioPlayer colaborates with MediaSession
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Low |
| Status | Closed |
| Resolution | Invalid |
| Resolution Date | 2016-08-21T22:39:54.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Android |
| Labels | android, mediasession |
| Reporter | Rainer Schleevoigt |
| Assignee | Chee Kiat Ng |
| Created | 2016-08-10T10:50:20.000+0000 |
| Updated | 2016-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
Hello, Can you provide a sample test case so we can test the issue. Thanks.
This is a feature-request to incorporate with his native module. Please do a core-contribution to get this integrated, thanks!
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.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.