diff --git a/android/src/main/java/com/transparentvideo/AlphaMovieView.java b/android/src/main/java/com/transparentvideo/AlphaMovieView.java index e02845c..4804146 100644 --- a/android/src/main/java/com/transparentvideo/AlphaMovieView.java +++ b/android/src/main/java/com/transparentvideo/AlphaMovieView.java @@ -334,8 +334,6 @@ public class AlphaMovieView extends GLTextureView { AssetFileDescriptor afd = context.getResources().openRawResourceFd(resId); if (afd == null) return; - mediaPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength()); - FileDescriptor fileDescriptor = afd.getFileDescriptor(); long startOffset = afd.getStartOffset(); long endOffset = afd.getLength(); @@ -347,7 +345,7 @@ public class AlphaMovieView extends GLTextureView { onDataSourceSet(retriever); } catch (IOException e) { - Log.e(TAG, e.getMessage(), e); + Log.e(TAG + " setVideoFromResourceId", e.getMessage(), e); } } diff --git a/android/src/main/java/com/transparentvideo/TransparentVideoViewManager.java b/android/src/main/java/com/transparentvideo/TransparentVideoViewManager.java index f6c7a0b..abfffbe 100644 --- a/android/src/main/java/com/transparentvideo/TransparentVideoViewManager.java +++ b/android/src/main/java/com/transparentvideo/TransparentVideoViewManager.java @@ -4,6 +4,7 @@ import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import android.content.Context; import android.os.Bundle; +import android.util.Log; import android.view.Gravity; import android.widget.LinearLayout; @@ -24,6 +25,7 @@ public class TransparentVideoViewManager extends SimpleViewManager private static List sInstances = new ArrayList<>(); public static final String REACT_CLASS = "TransparentVideoView"; + private static final String TAG = "TransparentVideoViewManager"; ReactApplicationContext reactContext; @@ -64,8 +66,11 @@ public class TransparentVideoViewManager extends SimpleViewManager String file = src.getString("uri"); try { Integer rawResourceId = Utils.getRawResourceId(reactContext, file); + Log.d(TAG + " setSrc", "ResourceID: " + rawResourceId); + alphaMovieView.setVideoFromResourceId(reactContext, rawResourceId); } catch (RuntimeException e) { + Log.e(TAG + " setSrc", e.getMessage(), e); alphaMovieView.setVideoByUrl(file); } }