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:
@@ -9,34 +9,37 @@ import React, {
|
||||
} from 'react';
|
||||
import {View, StyleSheet, Image, Platform} from 'react-native';
|
||||
import NativeVideoComponent, {
|
||||
type OnAudioFocusChangedData,
|
||||
type OnAudioTracksData,
|
||||
type OnBandwidthUpdateData,
|
||||
type OnBufferData,
|
||||
type OnExternalPlaybackChangeData,
|
||||
type OnGetLicenseData,
|
||||
type OnLoadData,
|
||||
type OnLoadStartData,
|
||||
type OnPictureInPictureStatusChangedData,
|
||||
type OnPlaybackStateChangedData,
|
||||
type OnProgressData,
|
||||
type OnReceiveAdEventData,
|
||||
type OnSeekData,
|
||||
type OnTextTrackDataChangedData,
|
||||
type OnTextTracksData,
|
||||
type OnTimedMetadataData,
|
||||
type OnVideoAspectRatioData,
|
||||
type OnVideoErrorData,
|
||||
type OnVideoTracksData,
|
||||
type VideoComponentType,
|
||||
} from './VideoNativeComponent';
|
||||
type VideoSrc,
|
||||
} from './specs/VideoNativeComponent';
|
||||
|
||||
import type {StyleProp, ImageStyle, NativeSyntheticEvent} from 'react-native';
|
||||
import {getReactTag, resolveAssetSourceForVideo} from './utils';
|
||||
import {VideoManager} from './VideoNativeComponent';
|
||||
import type {
|
||||
OnAudioFocusChangedData,
|
||||
OnAudioTracksData,
|
||||
OnBandwidthUpdateData,
|
||||
OnBufferData,
|
||||
OnExternalPlaybackChangeData,
|
||||
OnGetLicenseData,
|
||||
OnLoadData,
|
||||
OnLoadStartData,
|
||||
OnPictureInPictureStatusChangedData,
|
||||
OnPlaybackStateChangedData,
|
||||
OnProgressData,
|
||||
OnReceiveAdEventData,
|
||||
OnSeekData,
|
||||
OnTextTrackDataChangedData,
|
||||
OnTextTracksData,
|
||||
OnTimedMetadataData,
|
||||
OnVideoAspectRatioData,
|
||||
OnVideoErrorData,
|
||||
OnVideoTracksData,
|
||||
ReactVideoProps,
|
||||
} from './types';
|
||||
import {
|
||||
generateHeaderForNative,
|
||||
getReactTag,
|
||||
resolveAssetSourceForVideo,
|
||||
} from './utils';
|
||||
import {VideoManager} from './specs/VideoNativeComponent';
|
||||
import type {ReactVideoProps} from './types/video';
|
||||
|
||||
export type VideoSaveData = {
|
||||
uri: string;
|
||||
@@ -120,11 +123,10 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
||||
[posterResizeMode],
|
||||
);
|
||||
|
||||
const src = useMemo(() => {
|
||||
const src = useMemo<VideoSrc | undefined>(() => {
|
||||
if (!source) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const resolvedSource = resolveAssetSourceForVideo(source);
|
||||
let uri = resolvedSource.uri || '';
|
||||
if (uri && uri.match(/^\//)) {
|
||||
@@ -149,7 +151,7 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
||||
type: resolvedSource.type || '',
|
||||
mainVer: resolvedSource.mainVer || 0,
|
||||
patchVer: resolvedSource.patchVer || 0,
|
||||
requestHeaders: resolvedSource.headers || {},
|
||||
requestHeaders: generateHeaderForNative(resolvedSource.headers),
|
||||
startPosition: resolvedSource.startPosition ?? -1,
|
||||
cropStart: resolvedSource.cropStart || 0,
|
||||
cropEnd: resolvedSource.cropEnd,
|
||||
@@ -168,7 +170,7 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
||||
return {
|
||||
type: drm.type,
|
||||
licenseServer: drm.licenseServer,
|
||||
headers: drm.headers,
|
||||
headers: generateHeaderForNative(drm.headers),
|
||||
contentId: drm.contentId,
|
||||
certificateUrl: drm.certificateUrl,
|
||||
base64Certificate: drm.base64Certificate,
|
||||
@@ -180,10 +182,13 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
||||
if (!selectedTextTrack) {
|
||||
return;
|
||||
}
|
||||
const value = selectedTextTrack.value
|
||||
? `${selectedTextTrack.value}`
|
||||
: undefined;
|
||||
|
||||
return {
|
||||
type: selectedTextTrack?.type,
|
||||
value: selectedTextTrack?.value,
|
||||
value,
|
||||
};
|
||||
}, [selectedTextTrack]);
|
||||
|
||||
@@ -191,10 +196,13 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
||||
if (!selectedAudioTrack) {
|
||||
return;
|
||||
}
|
||||
const value = selectedAudioTrack.value
|
||||
? `${selectedAudioTrack.value}`
|
||||
: undefined;
|
||||
|
||||
return {
|
||||
type: selectedAudioTrack?.type,
|
||||
value: selectedAudioTrack?.value,
|
||||
value,
|
||||
};
|
||||
}, [selectedAudioTrack]);
|
||||
|
||||
|
Reference in New Issue
Block a user