diff --git a/android/build.gradle b/android/build.gradle index 32ac878a..5c04d95b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -17,5 +17,5 @@ android { dependencies { provided 'com.facebook.react:react-native:+' - compile 'com.yqritc:android-scalablevideoview:1.0.1' + compile 'com.yqritc:android-scalablevideoview:1.0.4' } diff --git a/android/src/main/java/com/brentvatne/react/ReactVideoView.java b/android/src/main/java/com/brentvatne/react/ReactVideoView.java index 0a194c90..5a27bdf2 100644 --- a/android/src/main/java/com/brentvatne/react/ReactVideoView.java +++ b/android/src/main/java/com/brentvatne/react/ReactVideoView.java @@ -194,8 +194,7 @@ public class ReactVideoView extends ScalableVideoView implements MediaPlayer.OnP } if ( mMediaPlayer != null ) { mMediaPlayerValid = false; - mMediaPlayer.stop(); - mMediaPlayer.release(); + release(); } } @@ -296,9 +295,8 @@ public class ReactVideoView extends ScalableVideoView implements MediaPlayer.OnP event.putMap(ReactVideoViewManager.PROP_SRC, src); mEventEmitter.receiveEvent(getId(), Events.EVENT_LOAD_START.toString(), event); - // not async to prevent random crashes on Android playback from local resource due to race conditions try { - prepare(this); + prepareAsync(this); } catch (Exception e) { e.printStackTrace(); }