Skip to content
Snippets Groups Projects
Commit 6da9696a authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Prevent PiP when picking subs

Close #306
parent a3a49f1c
No related branches found
No related tags found
No related merge requests found
......@@ -235,6 +235,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
private boolean mDragging;
private boolean mShowing;
private boolean mShowingDialog;
private DelayState mPlaybackSetting = DelayState.OFF;
private SeekBar mSeekbar;
private TextView mTitle;
......@@ -502,6 +503,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
@Override
protected void onResume() {
super.onResume();
mShowingDialog = false;
/*
* Set listeners here to avoid NPE when activity is closing
*/
......@@ -592,7 +594,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
(AndroidUtil.isNougatOrLater && !AndroidUtil.isOOrLater //Video on background on Nougat Android TVs
&& AndroidDevices.isAndroidTv() && !requestVisibleBehind(true)))
stopPlayback();
else if ("2".equals(mSettings.getString(PreferencesActivity.KEY_VIDEO_APP_SWITCH, "0")) && isInteractive()) {
else if (!mShowingDialog && "2".equals(mSettings.getString(PreferencesActivity.KEY_VIDEO_APP_SWITCH, "0")) && isInteractive()) {
switchToPopup();
}
}
......@@ -2370,6 +2372,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
} else if (item.getItemId() == R.id.video_menu_subtitles_picker) {
if (mUri == null)
return false;
mShowingDialog = true;
Intent filePickerIntent = new Intent(context, FilePickerActivity.class);
filePickerIntent.setData(Uri.parse(FileUtils.getParent(mUri.toString())));
context.startActivityForResult(filePickerIntent, 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment