mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-21 22:27:29 +00:00
close #1395
app will pause the video when navigating away and is independent of the play-in-background preference
This commit is contained in:
parent
4a295f0617
commit
eba0951176
@ -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() {
|
||||
final Bundle arguments = getArguments();
|
||||
if (arguments == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user