Skip to content

Commit

Permalink
Fabric (New Architecture) codegen support (#3487)
Browse files Browse the repository at this point in the history
* feat: implemented codegenConfig on package.json

* chore: moved directory location of Fabric component

* fix: typefix FabricExample

* chore: pod instaslled FabricExample iOS app

* feat: implemented codegen config on package.json

* feat: implemented codegen of specs/VideoNativeComponent

* chore: removed not using type Filter

* feat: removed unnecessary export on codegen tyepes

* Revert "feat: removed unnecessary export on codegen tyepes"

This reverts commit fc243b0.

* refactor: fixed types on Video component and modified types with codegen types

* feat: modified codegenNativeComponent naming (RCTVideo)

* feat: pod installed example basic app

* feat: bump up react-native dev dependency version to 0.73.2 for supporting codegen array event params

* feat: support array param types on event callback function codegen types

* chore: pod installed ios basic example

* feat: modified source prop as optional type

* feat: add original src/VideoComponent.ts again

* Revert "feat: add original src/VideoComponent.ts again"

This reverts commit d63ac94.

* feat: add original src/VideoComponent.ts again with original file name

* feat: git rm src/specs/VideoNativeComponent.ts

* feat: git mv VideoNativeComponent.ts

* feat: git mv src/specs/VideoNativeComponent.ts

* feat: git mv src/VideoNativeComponent.ts src/specs/VideoNativeComponent.ts

* feat: implemented array type handling on android JAVA

* feat: updated iOS requestHeaders parsing native

* feat: use safeGetArray on android, removed not using import too

* feat: temporary commit - reusing enum types for remaining docs types

* feat: implemented mixed type of SelectedTrack.value for JS layer
  • Loading branch information
yungblud authored Mar 7, 2024
1 parent 16f3cdb commit b33e6df
Show file tree
Hide file tree
Showing 16 changed files with 1,325 additions and 1,219 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableMapKeySetIterator;
import com.facebook.react.common.MapBuilder;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewGroupManager;
Expand Down Expand Up @@ -128,18 +127,19 @@ public void setDRM(final ReactExoplayerView videoView, @Nullable ReadableMap drm
if (drm != null && drm.hasKey(PROP_DRM_TYPE)) {
String drmType = ReactBridgeUtils.safeGetString(drm, PROP_DRM_TYPE);
String drmLicenseServer = ReactBridgeUtils.safeGetString(drm, PROP_DRM_LICENSESERVER);
ReadableMap drmHeaders = ReactBridgeUtils.safeGetMap(drm, PROP_DRM_HEADERS);
ReadableArray drmHeadersArray = ReactBridgeUtils.safeGetArray(drm, PROP_DRM_HEADERS);
if (drmType != null && drmLicenseServer != null && Util.getDrmUuid(drmType) != null) {
UUID drmUUID = Util.getDrmUuid(drmType);
videoView.setDrmType(drmUUID);
videoView.setDrmLicenseUrl(drmLicenseServer);
if (drmHeaders != null) {
if (drmHeadersArray != null) {
ArrayList<String> drmKeyRequestPropertiesList = new ArrayList<>();
ReadableMapKeySetIterator itr = drmHeaders.keySetIterator();
while (itr.hasNextKey()) {
String key = itr.nextKey();
for (int i = 0; i < drmHeadersArray.size(); i++) {
ReadableMap current = drmHeadersArray.getMap(i);
String key = current.hasKey("key") ? current.getString("key") : null;
String value = current.hasKey("value") ? current.getString("value") : null;
drmKeyRequestPropertiesList.add(key);
drmKeyRequestPropertiesList.add(drmHeaders.getString(key));
drmKeyRequestPropertiesList.add(value);
}
videoView.setDrmLicenseHeader(drmKeyRequestPropertiesList.toArray(new String[0]));
}
Expand All @@ -157,7 +157,20 @@ public void setSrc(final ReactExoplayerView videoView, @Nullable ReadableMap src
int cropEndMs = ReactBridgeUtils.safeGetInt(src, PROP_SRC_CROP_END, -1);
String extension = ReactBridgeUtils.safeGetString(src, PROP_SRC_TYPE, null);

Map<String, String> headers = src.hasKey(PROP_SRC_HEADERS) ? ReactBridgeUtils.toStringMap(src.getMap(PROP_SRC_HEADERS)) : new HashMap<>();
Map<String, String> headers = new HashMap<>();
ReadableArray propSrcHeadersArray = ReactBridgeUtils.safeGetArray(src, PROP_SRC_HEADERS);
if (propSrcHeadersArray != null) {
if (propSrcHeadersArray.size() > 0) {
for (int i = 0; i < propSrcHeadersArray.size(); i++) {
ReadableMap current = propSrcHeadersArray.getMap(i);
String key = current.hasKey("key") ? current.getString("key") : null;
String value = current.hasKey("value") ? current.getString("value") : null;
if (key != null && value != null) {
headers.put(key, value);
}
}
}
}

if (TextUtils.isEmpty(uriString)) {
videoView.clearSrc();
Expand Down
13 changes: 13 additions & 0 deletions examples/FabricExample/ios/FabricExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand All @@ -597,6 +598,10 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
};
Expand Down Expand Up @@ -638,6 +643,10 @@
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand All @@ -661,6 +670,10 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand Down
Loading

0 comments on commit b33e6df

Please sign in to comment.