Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[expo-av] Fix exception on Android when loading invalid Video source #9596

Merged
merged 2 commits into from
Aug 7, 2020

Conversation

IjzerenHein
Copy link
Contributor

@IjzerenHein IjzerenHein commented Aug 6, 2020

Why

Fix invalid state when loading a source fails. This leads to an exception when loading a new source.
Fixes #9185

How

When an error occurred, the MediaController was cleaned up. Upon loading a new source after that, an exception occurred because the mMediaController variable was null.

  • Test for existence of media-controller in all places
  • Re-create the Media Controller upon loading a new source

Test Plan

  • Verified that the problem no longer occurred using test app
  • All test-suite tests pass

Steps to reproduce:

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2020

Native Component List for this branch is ready

Copy link

@Bug-Generator Bug-Generator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there but looks good to me

Comment on lines 400 to +406
}

mPlayerData.setStatusUpdateListener(mStatusUpdateListener);

if (mMediaController == null) {
mMediaController = new MediaController(VideoView.this.getContext());
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run linter to parry this, update changeLog and this should be good to go

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a look! Updated the changelog 👍

Run linter to parry this

Please elaborate

@IjzerenHein IjzerenHein marked this pull request as ready for review August 7, 2020 08:48
Copy link
Contributor

@bbarthec bbarthec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@IjzerenHein IjzerenHein merged commit 1dc4fdb into master Aug 7, 2020
@IjzerenHein IjzerenHein deleted the @hein/expo-av/fix-bad-source-crash branch August 7, 2020 09:18
Jamedjo pushed a commit to Jamedjo/expo that referenced this pull request Feb 4, 2021
…xpo#9596)

* [expo-av] Fix exception on Android when loading invalid Video source

* [expo-av] Update changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[expo-av] NullPointerException at VideoView.java
3 participants