-Fixed player new share intent causing main player crash due to player activity in background.
This commit is contained in:
parent
4fbd1182c2
commit
ef16145695
2 changed files with 6 additions and 3 deletions
|
@ -1147,11 +1147,11 @@ public abstract class BasePlayer implements
|
||||||
|
|
||||||
@Player.RepeatMode
|
@Player.RepeatMode
|
||||||
public int getRepeatMode() {
|
public int getRepeatMode() {
|
||||||
return simpleExoPlayer.getRepeatMode();
|
return simpleExoPlayer == null ? Player.REPEAT_MODE_OFF : simpleExoPlayer.getRepeatMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRepeatMode(@Player.RepeatMode final int repeatMode) {
|
public void setRepeatMode(@Player.RepeatMode final int repeatMode) {
|
||||||
simpleExoPlayer.setRepeatMode(repeatMode);
|
if (simpleExoPlayer != null) simpleExoPlayer.setRepeatMode(repeatMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getPlaybackSpeed() {
|
public float getPlaybackSpeed() {
|
||||||
|
|
|
@ -153,7 +153,10 @@ public final class MainVideoPlayer extends AppCompatActivity
|
||||||
protected void onNewIntent(Intent intent) {
|
protected void onNewIntent(Intent intent) {
|
||||||
if (DEBUG) Log.d(TAG, "onNewIntent() called with: intent = [" + intent + "]");
|
if (DEBUG) Log.d(TAG, "onNewIntent() called with: intent = [" + intent + "]");
|
||||||
super.onNewIntent(intent);
|
super.onNewIntent(intent);
|
||||||
playerImpl.handleIntent(intent);
|
if (intent != null) {
|
||||||
|
playerState = null;
|
||||||
|
playerImpl.handleIntent(intent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue