[Android] Prepare media player asynchronously

This commit is contained in:
Baris Sencan 2015-11-13 14:35:52 -08:00
parent 44203ab9d6
commit e63a004ee6

View File

@ -88,12 +88,8 @@ public class ReactVideoView extends ScalableVideoView implements MediaPlayer.OnP
} }
} }
public void reset() {
mMediaPlayer.reset();
}
public void setSrc(final String uriString, final boolean isNetwork) throws IOException { public void setSrc(final String uriString, final boolean isNetwork) throws IOException {
reset(); mMediaPlayer.reset();
if (isNetwork) { if (isNetwork) {
setDataSource(uriString); setDataSource(uriString);
@ -105,7 +101,7 @@ public class ReactVideoView extends ScalableVideoView implements MediaPlayer.OnP
)); ));
} }
prepare(this); prepareAsync(this);
} }
public void setResizeModeModifier(final ScalableType resizeMode) { public void setResizeModeModifier(final ScalableType resizeMode) {