mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-17 20:20:50 +01:00
Merge branch 'master' of https://github.com/bkrodgers/Subsonic-Android-archrival
This commit is contained in:
commit
edd5fdb5a5
@ -800,6 +800,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
|
|||||||
remoteControlClientCompat
|
remoteControlClientCompat
|
||||||
.editMetadata(true)
|
.editMetadata(true)
|
||||||
.putString(MediaMetadataRetriever.METADATA_KEY_TITLE, title)
|
.putString(MediaMetadataRetriever.METADATA_KEY_TITLE, title)
|
||||||
|
.putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, currentSong.getArtist())
|
||||||
.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, album)
|
.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, album)
|
||||||
.putLong(MediaMetadataRetriever.METADATA_KEY_DURATION, duration)
|
.putLong(MediaMetadataRetriever.METADATA_KEY_DURATION, duration)
|
||||||
.putBitmap(RemoteControlClientCompat.MetadataEditorCompat.METADATA_KEY_ARTWORK, bitmap)
|
.putBitmap(RemoteControlClientCompat.MetadataEditorCompat.METADATA_KEY_ARTWORK, bitmap)
|
||||||
@ -875,7 +876,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
|
|||||||
mp.start();
|
mp.start();
|
||||||
setPlayerState(STARTED);
|
setPlayerState(STARTED);
|
||||||
} else {
|
} else {
|
||||||
setPlayerState(PAUSED);
|
setPlayerState(STOPPED);
|
||||||
}
|
}
|
||||||
|
|
||||||
lifecycleSupport.serializeDownloadQueue();
|
lifecycleSupport.serializeDownloadQueue();
|
||||||
|
@ -200,6 +200,8 @@ public class DownloadServiceLifecycleSupport {
|
|||||||
|
|
||||||
// Work-around: Serialize again, as the restore() method creates a serialization without current playing info.
|
// Work-around: Serialize again, as the restore() method creates a serialization without current playing info.
|
||||||
serializeDownloadQueue();
|
serializeDownloadQueue();
|
||||||
|
|
||||||
|
downloadService.setPlayerState(PlayerState.STOPPED);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleKeyEvent(KeyEvent event) {
|
private void handleKeyEvent(KeyEvent event) {
|
||||||
@ -209,6 +211,8 @@ public class DownloadServiceLifecycleSupport {
|
|||||||
|
|
||||||
switch (event.getKeyCode()) {
|
switch (event.getKeyCode()) {
|
||||||
case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
|
case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
|
||||||
|
case KeyEvent.KEYCODE_MEDIA_PLAY:
|
||||||
|
case KeyEvent.KEYCODE_MEDIA_PAUSE:
|
||||||
case KeyEvent.KEYCODE_HEADSETHOOK:
|
case KeyEvent.KEYCODE_HEADSETHOOK:
|
||||||
downloadService.togglePlayPause();
|
downloadService.togglePlayPause();
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user