From 1d67b7959e42c30512ecfe6e767def4ec83b85e1 Mon Sep 17 00:00:00 2001 From: Igor Ivanov Date: Wed, 11 May 2016 12:25:50 +0300 Subject: [PATCH] Allow to use content:// schema as source. --- .../src/main/java/com/brentvatne/react/ReactVideoView.java | 7 ++++++- 1 file changed, 6 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 c322ecd8..3e44bfbe 100644 --- a/android/src/main/java/com/brentvatne/react/ReactVideoView.java +++ b/android/src/main/java/com/brentvatne/react/ReactVideoView.java @@ -144,7 +144,12 @@ public class ReactVideoView extends ScalableVideoView implements MediaPlayer.OnP setDataSource(mThemedReactContext, parsedUrl, headers); } else if (isAsset) { - setDataSource(uriString); + if (uriString.startsWith("content://")) { + Uri parsedUrl = Uri.parse(uriString); + setDataSource(mThemedReactContext, parsedUrl); + } else { + setDataSource(uriString); + } } else { setRawData(mThemedReactContext.getResources().getIdentifier( uriString,