From 9ce1f4b5f41c1d9901f25ab180692a93d478c8df Mon Sep 17 00:00:00 2001 From: Gorjan Date: Tue, 21 Mar 2017 21:24:32 +0100 Subject: [PATCH] Fix/494 (#537) * 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 --- .../main/java/com/brentvatne/react/ReactVideoView.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/brentvatne/react/ReactVideoView.java b/android/src/main/java/com/brentvatne/react/ReactVideoView.java index 0c9e2149..0a194c90 100644 --- a/android/src/main/java/com/brentvatne/react/ReactVideoView.java +++ b/android/src/main/java/com/brentvatne/react/ReactVideoView.java @@ -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; }