1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-22 06:37:30 +00:00
app will pause the video when navigating away and is independent of the play-in-background preference
This commit is contained in:
Austin Huang 2021-07-13 21:46:13 -04:00
parent 4a295f0617
commit eba0951176
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F

View File

@ -274,6 +274,25 @@ public class PostViewV2Fragment extends Fragment implements EditTextDialogFragme
} }
} }
@Override
public void onPrimaryNavigationFragmentChanged(final boolean isPrimaryNavigationFragment) {
if (!isPrimaryNavigationFragment) {
final Media media = viewModel.getMedia();
switch (media.getType()) {
case MEDIA_TYPE_VIDEO:
if (videoPlayerViewHelper != null) {
videoPlayerViewHelper.pause();
}
return;
case MEDIA_TYPE_SLIDER:
if (sliderItemsAdapter != null) {
pauseSliderPlayer();
}
default:
}
}
}
private void init() { private void init() {
final Bundle arguments = getArguments(); final Bundle arguments = getArguments();
if (arguments == null) { if (arguments == null) {