diff --git a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java index 3e076bea..4e995904 100644 --- a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java +++ b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java @@ -84,10 +84,17 @@ public class ReactExoplayerViewManager extends ViewGroupManager 0) { Uri srcUri = RawResourceDataSource.buildRawResourceUri(identifier); if (srcUri != null) { diff --git a/android/src/main/java/com/brentvatne/react/ReactVideoView.java b/android/src/main/java/com/brentvatne/react/ReactVideoView.java index 3db80d39..0c9e2149 100644 --- a/android/src/main/java/com/brentvatne/react/ReactVideoView.java +++ b/android/src/main/java/com/brentvatne/react/ReactVideoView.java @@ -258,11 +258,19 @@ public class ReactVideoView extends ScalableVideoView implements MediaPlayer.OnP } } if(fd==null) { - setRawData(mThemedReactContext.getResources().getIdentifier( + int identifier = mThemedReactContext.getResources().getIdentifier( + uriString, + "drawable", + mThemedReactContext.getPackageName() + ); + if (identifier == 0) { + identifier = mThemedReactContext.getResources().getIdentifier( uriString, "raw", mThemedReactContext.getPackageName() - )); + ); + } + setRawData(identifier); } else { setDataSource(fd.getFileDescriptor(), fd.getStartOffset(),fd.getLength()); diff --git a/example/android/app/src/main/java/com/videoplayer/MainApplication.java b/example/android/app/src/main/java/com/videoplayer/MainApplication.java index 70334478..d3d3a231 100644 --- a/example/android/app/src/main/java/com/videoplayer/MainApplication.java +++ b/example/android/app/src/main/java/com/videoplayer/MainApplication.java @@ -14,27 +14,17 @@ import java.util.List; public class MainApplication extends Application implements ReactApplication { - private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { - @Override - protected boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - return Arrays.asList( - new MainReactPackage(), - new ReactVideoPackage() - ); - } - }; + private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { + @Override + public boolean getUseDeveloperSupport() { + return BuildConfig.DEBUG; + } @Override - protected List getPackages() { - return Arrays.asList( - new MainReactPackage(), - new ReactVideoPackage() + return Arrays.asList( + new MainReactPackage(), + new ReactVideoPackage() ); } }; diff --git a/example/android/app/src/main/res/raw/broadchurch.mp4 b/example/android/app/src/main/res/raw/broadchurch.mp4 deleted file mode 100644 index 7a7a4949..00000000 Binary files a/example/android/app/src/main/res/raw/broadchurch.mp4 and /dev/null differ diff --git a/example/index.android.js b/example/index.android.js index 0e787a6b..1242ddd0 100644 --- a/example/index.android.js +++ b/example/index.android.js @@ -105,9 +105,8 @@ class VideoPlayer extends Component {