fix crash bug when trying to play content

This commit is contained in:
Akinwale Ariwodola 2021-08-19 12:27:18 +01:00
parent 696bc86b7c
commit b60ca39df1

View file

@ -316,7 +316,10 @@ public class FileViewFragment extends BaseFragment implements
hideBuffering(); hideBuffering();
if (loadingNewClaim) { if (loadingNewClaim) {
MainActivity.appPlayer.setPlayWhenReady(Objects.requireNonNull((MainActivity) (getActivity())).isMediaAutoplayEnabled()); Context context = getContext();
if (context instanceof MainActivity) {
MainActivity.appPlayer.setPlayWhenReady(((MainActivity) context).isMediaAutoplayEnabled());
}
loadingNewClaim = false; loadingNewClaim = false;
} }
} else if (playbackState == Player.STATE_BUFFERING) { } else if (playbackState == Player.STATE_BUFFERING) {