Commit 40ccbc2f authored by Geoffrey Métais's avatar Geoffrey Métais

Video Player: Ensure playback is always started

parent 0158723c
......@@ -299,7 +299,6 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
mEnableCloneMode = mSettings.getBoolean("enable_clone_mode", false);
mDisplayManager = new DisplayManager(this, PlaybackService.Companion.getRenderer(), false, mEnableCloneMode, mIsBenchmark);
setContentView(mDisplayManager.isPrimary() ? R.layout.player : R.layout.player_remote_control);
PlaybackService.Companion.getService().observe(this, this);
/** initialize Views an their Events */
mActionBar = getSupportActionBar();
......@@ -569,6 +568,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
@Override
protected void onStart() {
super.onStart();
PlaybackService.Companion.getService().observe(this, this);
restoreBrightness();
final IntentFilter filter = new IntentFilter(Constants.PLAY_FROM_SERVICE);
filter.addAction(Constants.EXIT_PLAYER);
......@@ -584,6 +584,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
@Override
protected void onStop() {
super.onStop();
PlaybackService.Companion.getService().removeObservers(this);
LocalBroadcastManager.getInstance(this).unregisterReceiver(mServiceReceiver);
unregisterReceiver(mBtReceiver);
......@@ -2904,8 +2905,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
if (Permissions.checkReadStoragePermission(this, true) && !mSwitchingView)
mHandler.sendEmptyMessage(START_PLAYBACK);
mSwitchingView = false;
if (mService.getVolume() > 100 && !audioBoostEnabled)
mService.setVolume(100);
if (mService.getVolume() > 100 && !audioBoostEnabled) mService.setVolume(100);
} else {
mService = null;
mHandler.sendEmptyMessage(AUDIO_SERVICE_CONNECTION_FAILED);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment