Fabric (New Architecture) codegen support (#3487)

* 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 fc243b0ac5c565eda4886cd865c32ba4e812d7ff.

* 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 d63ac94e5330f7c7fb50374f65f8f3f4e0a225d7.

* 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
This commit is contained in:
yungblud
2024-03-07 19:35:17 +09:00
committed by GitHub
parent 16f3cdbd9a
commit b33e6df496
16 changed files with 1287 additions and 1181 deletions

View File

@@ -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;
@@ -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;
};
@@ -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;
@@ -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;

File diff suppressed because it is too large Load Diff

View File

@@ -11,7 +11,7 @@ import {
View,
} from 'react-native';
import Video, {FilterType, VideoRef} from 'react-native-video';
import Video, {FilterType, VideoRef, ResizeMode, IgnoreSilentSwitchType, MixWithOthersType} from 'react-native-video';
const filterTypes = [
FilterType.NONE,
@@ -32,7 +32,26 @@ const filterTypes = [
FilterType.SEPIA,
];
class VideoPlayer extends Component {
type SkinType = 'custom' | 'native' | 'embed'
type State = {
rate: number,
volume: number,
muted: boolean,
resizeMode: ResizeMode,
duration: number,
currentTime: number,
controls: boolean,
paused: boolean,
skin: SkinType,
ignoreSilentSwitch: IgnoreSilentSwitchType,
mixWithOthers: MixWithOthersType,
isBuffering: boolean,
filter: FilterType,
filterEnabled: boolean,
}
class VideoPlayer extends Component<{}, State> {
controlRef: React.RefObject<TouchableOpacity>;
videoRef: React.RefObject<VideoRef>;
constructor(props: any) {
@@ -44,18 +63,18 @@ class VideoPlayer extends Component {
this.controlRef = createRef();
this.videoRef = createRef();
}
state = {
state: State = {
rate: 1,
volume: 1,
muted: false,
resizeMode: 'contain',
resizeMode: ResizeMode.CONTAIN,
duration: 0.0,
currentTime: 0.0,
controls: false,
paused: true,
skin: 'custom',
ignoreSilentSwitch: null,
mixWithOthers: null,
ignoreSilentSwitch: IgnoreSilentSwitchType.IGNORE,
mixWithOthers: MixWithOthersType.DUCK,
isBuffering: false,
filter: FilterType.NONE,
filterEnabled: true,
@@ -110,7 +129,7 @@ class VideoPlayer extends Component {
});
}
renderSkinControl(skin) {
renderSkinControl(skin: 'custom' | 'native' | 'embed') {
const isSelected = this.state.skin == skin;
const selectControls = skin == 'native' || skin == 'embed';
return (
@@ -151,7 +170,7 @@ class VideoPlayer extends Component {
);
}
renderResizeModeControl(resizeMode: string) {
renderResizeModeControl(resizeMode: ResizeMode) {
const isSelected = this.state.resizeMode == resizeMode;
return (
@@ -189,7 +208,7 @@ class VideoPlayer extends Component {
);
}
renderIgnoreSilentSwitchControl(ignoreSilentSwitch: string) {
renderIgnoreSilentSwitchControl(ignoreSilentSwitch: IgnoreSilentSwitchType) {
const isSelected = this.state.ignoreSilentSwitch == ignoreSilentSwitch;
return (
@@ -208,7 +227,7 @@ class VideoPlayer extends Component {
);
}
renderMixWithOthersControl(mixWithOthers: string) {
renderMixWithOthersControl(mixWithOthers: MixWithOthersType) {
const isSelected = this.state.mixWithOthers == mixWithOthers;
return (
@@ -302,21 +321,21 @@ class VideoPlayer extends Component {
</View>
<View style={styles.resizeModeControl}>
{this.renderResizeModeControl('cover')}
{this.renderResizeModeControl('contain')}
{this.renderResizeModeControl('stretch')}
{this.renderResizeModeControl(ResizeMode.COVER)}
{this.renderResizeModeControl(ResizeMode.CONTAIN)}
{this.renderResizeModeControl(ResizeMode.STRETCH)}
</View>
</View>
<View style={styles.generalControls}>
{Platform.OS === 'ios' ? (
<>
<View style={styles.ignoreSilentSwitchControl}>
{this.renderIgnoreSilentSwitchControl('ignore')}
{this.renderIgnoreSilentSwitchControl('obey')}
{this.renderIgnoreSilentSwitchControl(IgnoreSilentSwitchType.IGNORE)}
{this.renderIgnoreSilentSwitchControl(IgnoreSilentSwitchType.OBEY)}
</View>
<View style={styles.mixWithOthersControl}>
{this.renderMixWithOthersControl('mix')}
{this.renderMixWithOthersControl('duck')}
{this.renderMixWithOthersControl(MixWithOthersType.MIX)}
{this.renderMixWithOthersControl(MixWithOthersType.DUCK)}
</View>
</>
) : null}
@@ -410,21 +429,21 @@ class VideoPlayer extends Component {
</View>
<View style={styles.resizeModeControl}>
{this.renderResizeModeControl('cover')}
{this.renderResizeModeControl('contain')}
{this.renderResizeModeControl('stretch')}
{this.renderResizeModeControl(ResizeMode.COVER)}
{this.renderResizeModeControl(ResizeMode.CONTAIN)}
{this.renderResizeModeControl(ResizeMode.STRETCH)}
</View>
</View>
<View style={styles.generalControls}>
{Platform.OS === 'ios' ? (
<>
<View style={styles.ignoreSilentSwitchControl}>
{this.renderIgnoreSilentSwitchControl('ignore')}
{this.renderIgnoreSilentSwitchControl('obey')}
{this.renderIgnoreSilentSwitchControl(IgnoreSilentSwitchType.IGNORE)}
{this.renderIgnoreSilentSwitchControl(IgnoreSilentSwitchType.OBEY)}
</View>
<View style={styles.mixWithOthersControl}>
{this.renderMixWithOthersControl('mix')}
{this.renderMixWithOthersControl('duck')}
{this.renderMixWithOthersControl(MixWithOthersType.MIX)}
{this.renderMixWithOthersControl(MixWithOthersType.DUCK)}
</View>
</>
) : null}

View File

@@ -4,9 +4,10 @@
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
"paths": {
"react-native-video": ["../../Video.js"]
"react-native-video": ["../../src/index.ts"],
"react": [ "./node_modules/@types/react" ]
},
/* Completeness */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
}
}

View File

@@ -889,10 +889,10 @@ PODS:
- React-Mapbuffer (0.73.2):
- glog
- React-debug
- react-native-video (6.0.0-beta.3):
- react-native-video (6.0.0-beta.4):
- React-Core
- react-native-video/Video (= 6.0.0-beta.3)
- react-native-video/Video (6.0.0-beta.3):
- react-native-video/Video (= 6.0.0-beta.4)
- react-native-video/Video (6.0.0-beta.4):
- PromisesSwift
- React-Core
- React-nativeconfig (0.73.2)
@@ -1235,11 +1235,11 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
boost: d3f49c53809116a5d38da093a8aa78bf551aed09
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953
FBLazyVector: fbc4957d9aa695250b55d879c1d86f79d7e69ab4
FBReactNativeSpec: 86de768f89901ef6ed3207cd686362189d64ac88
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
hermes-engine: b361c9ef5ef3cda53f66e195599b47e1f84ffa35
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
@@ -1265,7 +1265,7 @@ SPEC CHECKSUMS:
React-jsinspector: 03644c063fc3621c9a4e8bf263a8150909129618
React-logger: 66b168e2b2bee57bd8ce9e69f739d805732a5570
React-Mapbuffer: f40e0ea0df8161075390332dfcb0496442c09371
react-native-video: 60ecad11b7179ec0e2012dea643775b4fca9b224
react-native-video: 6078b448c21630b0a2937436527ad54fd2a1fdd8
React-nativeconfig: 4dda3cbbdd1c4ce38450bb10b34b3e54120e4a91
React-NativeModulesApple: d25a530c61e94fb317a0124b1cde1c459e4a47d3
React-perflogger: 29efe63b7ef5fbaaa50ef6eaa92482f98a24b97e

View File

@@ -591,6 +591,15 @@
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
);
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
@@ -611,11 +620,7 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
" ",
"-Wl -ld_classic ",
);
OTHER_LDFLAGS = "$(inherited)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
@@ -678,6 +683,15 @@
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
);
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
@@ -697,11 +711,7 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
" ",
"-Wl -ld_classic ",
);
OTHER_LDFLAGS = "$(inherited)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;