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:
@@ -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
@@ -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}
|
||||
|
@@ -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. */
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user