* Stop video autoplay when paused prop is 'true' on initial showing of video component

* Fix IOException - java.io.FileNotFoundException: No content provider: thrown in android.MediaPlayer, due to expected uri resource with content provider instead of only a URL
This commit is contained in:
Gorjan 2017-03-21 21:24:32 +01:00 committed by Matt Apperson
parent 911bc5222b
commit 9ce1f4b5f4

View File

@ -94,6 +94,7 @@ public class ReactVideoView extends ScalableVideoView implements MediaPlayer.OnP
private float mRate = 1.0f;
private boolean mPlayInBackground = false;
private boolean mActiveStatePauseStatus = false;
private boolean mActiveStatePauseStatusInitialized = false;
private int mMainVer = 0;
private int mPatchVer = 0;
@ -236,7 +237,7 @@ public class ReactVideoView extends ScalableVideoView implements MediaPlayer.OnP
headers.put("Cookie", cookie);
}
setDataSource(mThemedReactContext, parsedUrl, headers);
setDataSource(uriString);
} else if (isAsset) {
if (uriString.startsWith("content://")) {
Uri parsedUrl = Uri.parse(uriString);
@ -325,6 +326,11 @@ public class ReactVideoView extends ScalableVideoView implements MediaPlayer.OnP
mPaused = paused;
if ( !mActiveStatePauseStatusInitialized ) {
mActiveStatePauseStatus = mPaused;
mActiveStatePauseStatusInitialized = true;
}
if (!mMediaPlayerValid) {
return;
}