Added isAsset same as iOS implementation
This commit is contained in:
@@ -58,6 +58,7 @@ public class ReactVideoView extends ScalableVideoView implements MediaPlayer.OnP
|
||||
private String mSrcUriString = null;
|
||||
private String mSrcType = "mp4";
|
||||
private boolean mSrcIsNetwork = false;
|
||||
private boolean mSrcIsAsset = false;
|
||||
private ScalableType mResizeMode = ScalableType.LEFT_TOP;
|
||||
private boolean mRepeat = false;
|
||||
private boolean mPaused = false;
|
||||
@@ -107,10 +108,11 @@ public class ReactVideoView extends ScalableVideoView implements MediaPlayer.OnP
|
||||
}
|
||||
}
|
||||
|
||||
public void setSrc(final String uriString, final String type, final boolean isNetwork) {
|
||||
public void setSrc(final String uriString, final String type, final boolean isNetwork, final boolean isAsset) {
|
||||
mSrcUriString = uriString;
|
||||
mSrcType = type;
|
||||
mSrcIsNetwork = isNetwork;
|
||||
mSrcIsAsset = isAsset;
|
||||
|
||||
mMediaPlayerValid = false;
|
||||
mVideoDuration = 0;
|
||||
@@ -120,7 +122,7 @@ public class ReactVideoView extends ScalableVideoView implements MediaPlayer.OnP
|
||||
mMediaPlayer.reset();
|
||||
|
||||
try {
|
||||
if (isNetwork) {
|
||||
if (isNetwork || isAsset) {
|
||||
setDataSource(uriString);
|
||||
} else {
|
||||
setRawData(mThemedReactContext.getResources().getIdentifier(
|
||||
@@ -281,6 +283,6 @@ public class ReactVideoView extends ScalableVideoView implements MediaPlayer.OnP
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
setSrc(mSrcUriString, mSrcType, mSrcIsNetwork);
|
||||
setSrc(mSrcUriString, mSrcType, mSrcIsNetwork, mSrcIsAsset);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user