Merge pull request #4238 from ByteHamster/play-with-intent-on-state-unknown
Send play intent if service state is unknown
This commit is contained in:
commit
ac23c4b392
|
@ -77,7 +77,6 @@ public class ExternalPlayerFragment extends Fragment {
|
|||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
controller = setupPlaybackController();
|
||||
butPlay.setOnClickListener(v -> {
|
||||
if (controller != null) {
|
||||
controller.playPause();
|
||||
|
|
|
@ -508,6 +508,13 @@ public class PlaybackController {
|
|||
playbackService.setStartWhenPrepared(true);
|
||||
playbackService.prepare();
|
||||
break;
|
||||
default:
|
||||
new PlaybackServiceStarter(activity, media)
|
||||
.startWhenPrepared(true)
|
||||
.streamIfLastWasStream()
|
||||
.start();
|
||||
Log.w(TAG, "Play/Pause button was pressed and PlaybackService state was unknown");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue