allow audioplayer and videoplayer to pass the view intent to the service if the app happens to be casting at the moment
This commit is contained in:
parent
efacb68657
commit
900dbf7beb
|
@ -1,7 +1,6 @@
|
|||
package de.danoeh.antennapod.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
|
@ -16,17 +15,6 @@ import de.danoeh.antennapod.core.util.playback.ExternalMedia;
|
|||
public class AudioplayerActivity extends MediaplayerInfoActivity {
|
||||
public static final String TAG = "AudioPlayerActivity";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (CastManager.getInstance().isConnected()) {
|
||||
Intent intent = PlaybackService.getPlayerActivityIntent(this);
|
||||
if (!intent.getComponent().getClassName().equals(AudioplayerActivity.class.getName())) {
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
@ -43,6 +31,11 @@ public class AudioplayerActivity extends MediaplayerInfoActivity {
|
|||
launchIntent.putExtra(PlaybackService.EXTRA_PREPARE_IMMEDIATELY,
|
||||
true);
|
||||
startService(launchIntent);
|
||||
} else if (CastManager.getInstance().isConnected()) {
|
||||
Intent intent = PlaybackService.getPlayerActivityIntent(this);
|
||||
if (!intent.getComponent().getClassName().equals(AudioplayerActivity.class.getName())) {
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -65,12 +65,6 @@ public class VideoplayerActivity extends MediaplayerActivity {
|
|||
supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY); // has to be called before setting layout content
|
||||
super.onCreate(savedInstanceState);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(0x80000000));
|
||||
if (CastManager.getInstance().isConnected()) {
|
||||
Intent intent = PlaybackService.getPlayerActivityIntent(this);
|
||||
if (!intent.getComponent().getClassName().equals(VideoplayerActivity.class.getName())) {
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -90,6 +84,11 @@ public class VideoplayerActivity extends MediaplayerActivity {
|
|||
launchIntent.putExtra(PlaybackService.EXTRA_PREPARE_IMMEDIATELY,
|
||||
true);
|
||||
startService(launchIntent);
|
||||
} else if (CastManager.getInstance().isConnected()) {
|
||||
Intent intent = PlaybackService.getPlayerActivityIntent(this);
|
||||
if (!intent.getComponent().getClassName().equals(VideoplayerActivity.class.getName())) {
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue