fix: android resource id grabbing

This commit is contained in:
Brian Sztamfater 2023-06-08 18:29:10 +01:00
parent e49aa1e9f4
commit 97d8c773ea
2 changed files with 4 additions and 2 deletions

View File

@ -63,7 +63,9 @@ public class TransparentVideoViewManager extends SimpleViewManager<LinearLayout>
view.addView(alphaMovieView);
}
alphaMovieView.setPacked(true);
String file = src.getString("uri");
String file = src.getString("uri").toLowerCase();
Log.d(TAG + " setSrc", "file: " + file);
try {
Integer rawResourceId = Utils.getRawResourceId(reactContext, file);
Log.d(TAG + " setSrc", "ResourceID: " + rawResourceId);

View File

@ -5,6 +5,6 @@ import android.os.Bundle;
public class Utils {
public static int getRawResourceId(Context context, String resourceName) {
return context.getResources().getIdentifier(resourceName, "raw", context.getPackageName());
return context.getResources().getIdentifier("" + resourceName, "raw", context.getPackageName());
}
}