Skip to content

Commit

Permalink
fix crash bug when trying to play content
Browse files Browse the repository at this point in the history
  • Loading branch information
akinwale committed Aug 19, 2021
1 parent 696bc86 commit b60ca39
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ public void onPlaybackStateChanged(@Player.State int playbackState) {
hideBuffering();

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;
}
} else if (playbackState == Player.STATE_BUFFERING) {
Expand Down

0 comments on commit b60ca39

Please sign in to comment.