From d3d12b44060f4a14c1adf3ac296001ff3c5c4cba Mon Sep 17 00:00:00 2001 From: yungblud Date: Thu, 18 Jan 2024 16:28:56 +0900 Subject: [PATCH 01/28] feat: implemented codegenConfig on package.json --- package.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9d2dad3279..03412c3e92 100644 --- a/package.json +++ b/package.json @@ -63,5 +63,10 @@ "!**/*.tsbuildinfo", "!docs", "!examples" - ] + ], + "codegenConfig": { + "name": "RNCVideo", + "type": "components", + "jsSrcsDir": "src" + } } From f01fa46d81ae32ccf4de7280b0b263aef35ed5d4 Mon Sep 17 00:00:00 2001 From: yungblud Date: Thu, 18 Jan 2024 16:29:17 +0900 Subject: [PATCH 02/28] chore: moved directory location of Fabric component --- src/Video.tsx | 4 ++-- src/index.ts | 2 +- src/{ => specs}/VideoNativeComponent.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) rename src/{ => specs}/VideoNativeComponent.ts (98%) diff --git a/src/Video.tsx b/src/Video.tsx index 41d2aa6497..57e6539211 100644 --- a/src/Video.tsx +++ b/src/Video.tsx @@ -10,11 +10,11 @@ import React, { import {View, StyleSheet, Image, Platform} from 'react-native'; import NativeVideoComponent, { type VideoComponentType, -} from './VideoNativeComponent'; +} from './specs/VideoNativeComponent'; import type {StyleProp, ImageStyle, NativeSyntheticEvent} from 'react-native'; import {getReactTag, resolveAssetSourceForVideo} from './utils'; -import {VideoManager} from './VideoNativeComponent'; +import {VideoManager} from './specs/VideoNativeComponent'; import type { OnAudioFocusChangedData, OnAudioTracksData, diff --git a/src/index.ts b/src/index.ts index 331d806509..56fd87d241 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ import Video from './Video'; -export {VideoDecoderProperties} from './VideoNativeComponent'; +export {VideoDecoderProperties} from './specs/VideoNativeComponent'; export * from './types'; export type {VideoRef} from './Video'; export default Video; diff --git a/src/VideoNativeComponent.ts b/src/specs/VideoNativeComponent.ts similarity index 98% rename from src/VideoNativeComponent.ts rename to src/specs/VideoNativeComponent.ts index 9692356129..2ef0403eaa 100644 --- a/src/VideoNativeComponent.ts +++ b/src/specs/VideoNativeComponent.ts @@ -4,10 +4,10 @@ import type { ViewProps, } from 'react-native'; import {NativeModules, requireNativeComponent} from 'react-native'; -import type ResizeMode from './types/ResizeMode'; -import type FilterType from './types/FilterType'; -import type Orientation from './types/Orientation'; -import type {AdEvent, EnumValues, OnTextTracksTypeData} from './types'; +import type ResizeMode from '../types/ResizeMode'; +import type FilterType from '../types/FilterType'; +import type Orientation from '../types/Orientation'; +import type {AdEvent, EnumValues, OnTextTracksTypeData} from '../types'; // -------- There are types for native component (future codegen) -------- // if you are looking for types for react component, see src/types/video.ts From cbbab32f833ff641a30df50c505e84ef79634392 Mon Sep 17 00:00:00 2001 From: yungblud Date: Thu, 18 Jan 2024 16:42:11 +0900 Subject: [PATCH 03/28] fix: typefix FabricExample --- examples/FabricExample/src/VideoPlayer.tsx | 67 ++++++++++++++-------- examples/FabricExample/tsconfig.json | 5 +- 2 files changed, 46 insertions(+), 26 deletions(-) diff --git a/examples/FabricExample/src/VideoPlayer.tsx b/examples/FabricExample/src/VideoPlayer.tsx index 5ec1bc304f..34a4776b94 100644 --- a/examples/FabricExample/src/VideoPlayer.tsx +++ b/examples/FabricExample/src/VideoPlayer.tsx @@ -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; videoRef: React.RefObject; 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 { - {this.renderResizeModeControl('cover')} - {this.renderResizeModeControl('contain')} - {this.renderResizeModeControl('stretch')} + {this.renderResizeModeControl(ResizeMode.COVER)} + {this.renderResizeModeControl(ResizeMode.CONTAIN)} + {this.renderResizeModeControl(ResizeMode.STRETCH)} {Platform.OS === 'ios' ? ( <> - {this.renderIgnoreSilentSwitchControl('ignore')} - {this.renderIgnoreSilentSwitchControl('obey')} + {this.renderIgnoreSilentSwitchControl(IgnoreSilentSwitchType.IGNORE)} + {this.renderIgnoreSilentSwitchControl(IgnoreSilentSwitchType.OBEY)} - {this.renderMixWithOthersControl('mix')} - {this.renderMixWithOthersControl('duck')} + {this.renderMixWithOthersControl(MixWithOthersType.MIX)} + {this.renderMixWithOthersControl(MixWithOthersType.DUCK)} ) : null} @@ -410,21 +429,21 @@ class VideoPlayer extends Component { - {this.renderResizeModeControl('cover')} - {this.renderResizeModeControl('contain')} - {this.renderResizeModeControl('stretch')} + {this.renderResizeModeControl(ResizeMode.COVER)} + {this.renderResizeModeControl(ResizeMode.CONTAIN)} + {this.renderResizeModeControl(ResizeMode.STRETCH)} {Platform.OS === 'ios' ? ( <> - {this.renderIgnoreSilentSwitchControl('ignore')} - {this.renderIgnoreSilentSwitchControl('obey')} + {this.renderIgnoreSilentSwitchControl(IgnoreSilentSwitchType.IGNORE)} + {this.renderIgnoreSilentSwitchControl(IgnoreSilentSwitchType.OBEY)} - {this.renderMixWithOthersControl('mix')} - {this.renderMixWithOthersControl('duck')} + {this.renderMixWithOthersControl(MixWithOthersType.MIX)} + {this.renderMixWithOthersControl(MixWithOthersType.DUCK)} ) : null} diff --git a/examples/FabricExample/tsconfig.json b/examples/FabricExample/tsconfig.json index 6c939fc72a..4ab8fc695b 100644 --- a/examples/FabricExample/tsconfig.json +++ b/examples/FabricExample/tsconfig.json @@ -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. */ } } From 6f14e084885c5dd744afffb0fc57001e3dcc048d Mon Sep 17 00:00:00 2001 From: yungblud Date: Fri, 19 Jan 2024 13:33:04 +0900 Subject: [PATCH 04/28] chore: pod instaslled FabricExample iOS app --- .../FabricExample.xcodeproj/project.pbxproj | 13 + examples/FabricExample/ios/Podfile.lock | 1116 ++++++++--------- 2 files changed, 571 insertions(+), 558 deletions(-) diff --git a/examples/FabricExample/ios/FabricExample.xcodeproj/project.pbxproj b/examples/FabricExample/ios/FabricExample.xcodeproj/project.pbxproj index 7a06998065..8ef48fc2d8 100644 --- a/examples/FabricExample/ios/FabricExample.xcodeproj/project.pbxproj +++ b/examples/FabricExample/ios/FabricExample.xcodeproj/project.pbxproj @@ -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; diff --git a/examples/FabricExample/ios/Podfile.lock b/examples/FabricExample/ios/Podfile.lock index 2fc3f61321..cd35a33b95 100644 --- a/examples/FabricExample/ios/Podfile.lock +++ b/examples/FabricExample/ios/Podfile.lock @@ -2,14 +2,14 @@ PODS: - boost (1.76.0) - CocoaAsyncSocket (7.6.5) - DoubleConversion (1.1.6) - - FBLazyVector (0.71.12) - - FBReactNativeSpec (0.71.12): + - FBLazyVector (0.71.15) + - FBReactNativeSpec (0.71.15): - RCT-Folly (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-Core (= 0.71.12) - - React-jsi (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-Core (= 0.71.15) + - React-jsi (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) - Flipper (0.125.0): - Flipper-Folly (~> 2.6) - Flipper-RSocket (~> 1.4) @@ -73,9 +73,9 @@ PODS: - FlipperKit/FlipperKitNetworkPlugin - fmt (6.2.1) - glog (0.3.5) - - hermes-engine (0.71.12): - - hermes-engine/Pre-built (= 0.71.12) - - hermes-engine/Pre-built (0.71.12) + - hermes-engine (0.71.15): + - hermes-engine/Pre-built (= 0.71.15) + - hermes-engine/Pre-built (0.71.15) - libevent (2.1.12) - OpenSSL-Universal (1.1.1100) - PromisesObjC (2.2.0) @@ -103,26 +103,26 @@ PODS: - fmt (~> 6.2.1) - glog - libevent - - RCTRequired (0.71.12) - - RCTTypeSafety (0.71.12): - - FBLazyVector (= 0.71.12) - - RCTRequired (= 0.71.12) - - React-Core (= 0.71.12) - - React (0.71.12): - - React-Core (= 0.71.12) - - React-Core/DevSupport (= 0.71.12) - - React-Core/RCTWebSocket (= 0.71.12) - - React-RCTActionSheet (= 0.71.12) - - React-RCTAnimation (= 0.71.12) - - React-RCTBlob (= 0.71.12) - - React-RCTImage (= 0.71.12) - - React-RCTLinking (= 0.71.12) - - React-RCTNetwork (= 0.71.12) - - React-RCTSettings (= 0.71.12) - - React-RCTText (= 0.71.12) - - React-RCTVibration (= 0.71.12) - - React-callinvoker (0.71.12) - - React-Codegen (0.71.12): + - RCTRequired (0.71.15) + - RCTTypeSafety (0.71.15): + - FBLazyVector (= 0.71.15) + - RCTRequired (= 0.71.15) + - React-Core (= 0.71.15) + - React (0.71.15): + - React-Core (= 0.71.15) + - React-Core/DevSupport (= 0.71.15) + - React-Core/RCTWebSocket (= 0.71.15) + - React-RCTActionSheet (= 0.71.15) + - React-RCTAnimation (= 0.71.15) + - React-RCTBlob (= 0.71.15) + - React-RCTImage (= 0.71.15) + - React-RCTLinking (= 0.71.15) + - React-RCTNetwork (= 0.71.15) + - React-RCTSettings (= 0.71.15) + - React-RCTText (= 0.71.15) + - React-RCTVibration (= 0.71.15) + - React-callinvoker (0.71.15) + - React-Codegen (0.71.15): - FBReactNativeSpec - hermes-engine - RCT-Folly @@ -135,547 +135,547 @@ PODS: - React-rncore - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - React-Core (0.71.12): + - React-Core (0.71.15): - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.71.12) - - React-cxxreact (= 0.71.12) + - React-Core/Default (= 0.71.15) + - React-cxxreact (= 0.71.15) - React-hermes - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-perflogger (= 0.71.15) - Yoga - - React-Core/CoreModulesHeaders (0.71.12): + - React-Core/CoreModulesHeaders (0.71.15): - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.12) + - React-cxxreact (= 0.71.15) - React-hermes - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-perflogger (= 0.71.15) - Yoga - - React-Core/Default (0.71.12): + - React-Core/Default (0.71.15): - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-cxxreact (= 0.71.12) + - React-cxxreact (= 0.71.15) - React-hermes - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-perflogger (= 0.71.15) - Yoga - - React-Core/DevSupport (0.71.12): + - React-Core/DevSupport (0.71.15): - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.71.12) - - React-Core/RCTWebSocket (= 0.71.12) - - React-cxxreact (= 0.71.12) + - React-Core/Default (= 0.71.15) + - React-Core/RCTWebSocket (= 0.71.15) + - React-cxxreact (= 0.71.15) - React-hermes - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-jsinspector (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-jsinspector (= 0.71.15) + - React-perflogger (= 0.71.15) - Yoga - - React-Core/RCTActionSheetHeaders (0.71.12): + - React-Core/RCTActionSheetHeaders (0.71.15): - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.12) + - React-cxxreact (= 0.71.15) - React-hermes - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-perflogger (= 0.71.15) - Yoga - - React-Core/RCTAnimationHeaders (0.71.12): + - React-Core/RCTAnimationHeaders (0.71.15): - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.12) + - React-cxxreact (= 0.71.15) - React-hermes - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-perflogger (= 0.71.15) - Yoga - - React-Core/RCTBlobHeaders (0.71.12): + - React-Core/RCTBlobHeaders (0.71.15): - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.12) + - React-cxxreact (= 0.71.15) - React-hermes - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-perflogger (= 0.71.15) - Yoga - - React-Core/RCTImageHeaders (0.71.12): + - React-Core/RCTImageHeaders (0.71.15): - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.12) + - React-cxxreact (= 0.71.15) - React-hermes - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-perflogger (= 0.71.15) - Yoga - - React-Core/RCTLinkingHeaders (0.71.12): + - React-Core/RCTLinkingHeaders (0.71.15): - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.12) + - React-cxxreact (= 0.71.15) - React-hermes - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-perflogger (= 0.71.15) - Yoga - - React-Core/RCTNetworkHeaders (0.71.12): + - React-Core/RCTNetworkHeaders (0.71.15): - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.12) + - React-cxxreact (= 0.71.15) - React-hermes - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-perflogger (= 0.71.15) - Yoga - - React-Core/RCTSettingsHeaders (0.71.12): + - React-Core/RCTSettingsHeaders (0.71.15): - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.12) + - React-cxxreact (= 0.71.15) - React-hermes - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-perflogger (= 0.71.15) - Yoga - - React-Core/RCTTextHeaders (0.71.12): + - React-Core/RCTTextHeaders (0.71.15): - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.12) + - React-cxxreact (= 0.71.15) - React-hermes - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-perflogger (= 0.71.15) - Yoga - - React-Core/RCTVibrationHeaders (0.71.12): + - React-Core/RCTVibrationHeaders (0.71.15): - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.12) + - React-cxxreact (= 0.71.15) - React-hermes - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-perflogger (= 0.71.15) - Yoga - - React-Core/RCTWebSocket (0.71.12): + - React-Core/RCTWebSocket (0.71.15): - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.71.12) - - React-cxxreact (= 0.71.12) + - React-Core/Default (= 0.71.15) + - React-cxxreact (= 0.71.15) - React-hermes - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-perflogger (= 0.71.15) - Yoga - - React-CoreModules (0.71.12): + - React-CoreModules (0.71.15): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.71.12) - - React-Codegen (= 0.71.12) - - React-Core/CoreModulesHeaders (= 0.71.12) - - React-jsi (= 0.71.12) + - RCTTypeSafety (= 0.71.15) + - React-Codegen (= 0.71.15) + - React-Core/CoreModulesHeaders (= 0.71.15) + - React-jsi (= 0.71.15) - React-RCTBlob - - React-RCTImage (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-cxxreact (0.71.12): + - React-RCTImage (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-cxxreact (0.71.15): - boost (= 1.76.0) - DoubleConversion - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-callinvoker (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsinspector (= 0.71.12) - - React-logger (= 0.71.12) - - React-perflogger (= 0.71.12) - - React-runtimeexecutor (= 0.71.12) - - React-Fabric (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-Fabric/animations (= 0.71.12) - - React-Fabric/attributedstring (= 0.71.12) - - React-Fabric/butter (= 0.71.12) - - React-Fabric/componentregistry (= 0.71.12) - - React-Fabric/componentregistrynative (= 0.71.12) - - React-Fabric/components (= 0.71.12) - - React-Fabric/config (= 0.71.12) - - React-Fabric/core (= 0.71.12) - - React-Fabric/debug_core (= 0.71.12) - - React-Fabric/debug_renderer (= 0.71.12) - - React-Fabric/imagemanager (= 0.71.12) - - React-Fabric/leakchecker (= 0.71.12) - - React-Fabric/mapbuffer (= 0.71.12) - - React-Fabric/mounting (= 0.71.12) - - React-Fabric/runtimescheduler (= 0.71.12) - - React-Fabric/scheduler (= 0.71.12) - - React-Fabric/telemetry (= 0.71.12) - - React-Fabric/templateprocessor (= 0.71.12) - - React-Fabric/textlayoutmanager (= 0.71.12) - - React-Fabric/uimanager (= 0.71.12) - - React-Fabric/utils (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/animations (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/attributedstring (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/butter (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/componentregistry (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/componentregistrynative (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/components (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-Fabric/components/activityindicator (= 0.71.12) - - React-Fabric/components/image (= 0.71.12) - - React-Fabric/components/inputaccessory (= 0.71.12) - - React-Fabric/components/legacyviewmanagerinterop (= 0.71.12) - - React-Fabric/components/modal (= 0.71.12) - - React-Fabric/components/root (= 0.71.12) - - React-Fabric/components/safeareaview (= 0.71.12) - - React-Fabric/components/scrollview (= 0.71.12) - - React-Fabric/components/slider (= 0.71.12) - - React-Fabric/components/text (= 0.71.12) - - React-Fabric/components/textinput (= 0.71.12) - - React-Fabric/components/unimplementedview (= 0.71.12) - - React-Fabric/components/view (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/components/activityindicator (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/components/image (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/components/inputaccessory (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/components/legacyviewmanagerinterop (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/components/modal (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/components/root (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/components/safeareaview (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/components/scrollview (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/components/slider (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/components/text (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/components/textinput (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/components/unimplementedview (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/components/view (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) + - React-callinvoker (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsinspector (= 0.71.15) + - React-logger (= 0.71.15) + - React-perflogger (= 0.71.15) + - React-runtimeexecutor (= 0.71.15) + - React-Fabric (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-Fabric/animations (= 0.71.15) + - React-Fabric/attributedstring (= 0.71.15) + - React-Fabric/butter (= 0.71.15) + - React-Fabric/componentregistry (= 0.71.15) + - React-Fabric/componentregistrynative (= 0.71.15) + - React-Fabric/components (= 0.71.15) + - React-Fabric/config (= 0.71.15) + - React-Fabric/core (= 0.71.15) + - React-Fabric/debug_core (= 0.71.15) + - React-Fabric/debug_renderer (= 0.71.15) + - React-Fabric/imagemanager (= 0.71.15) + - React-Fabric/leakchecker (= 0.71.15) + - React-Fabric/mapbuffer (= 0.71.15) + - React-Fabric/mounting (= 0.71.15) + - React-Fabric/runtimescheduler (= 0.71.15) + - React-Fabric/scheduler (= 0.71.15) + - React-Fabric/telemetry (= 0.71.15) + - React-Fabric/templateprocessor (= 0.71.15) + - React-Fabric/textlayoutmanager (= 0.71.15) + - React-Fabric/uimanager (= 0.71.15) + - React-Fabric/utils (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/animations (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/attributedstring (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/butter (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/componentregistry (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/componentregistrynative (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/components (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-Fabric/components/activityindicator (= 0.71.15) + - React-Fabric/components/image (= 0.71.15) + - React-Fabric/components/inputaccessory (= 0.71.15) + - React-Fabric/components/legacyviewmanagerinterop (= 0.71.15) + - React-Fabric/components/modal (= 0.71.15) + - React-Fabric/components/root (= 0.71.15) + - React-Fabric/components/safeareaview (= 0.71.15) + - React-Fabric/components/scrollview (= 0.71.15) + - React-Fabric/components/slider (= 0.71.15) + - React-Fabric/components/text (= 0.71.15) + - React-Fabric/components/textinput (= 0.71.15) + - React-Fabric/components/unimplementedview (= 0.71.15) + - React-Fabric/components/view (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/components/activityindicator (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/components/image (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/components/inputaccessory (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/components/legacyviewmanagerinterop (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/components/modal (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/components/root (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/components/safeareaview (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/components/scrollview (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/components/slider (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/components/text (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/components/textinput (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/components/unimplementedview (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/components/view (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) - Yoga - - React-Fabric/config (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/core (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/debug_core (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/debug_renderer (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/imagemanager (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - React-RCTImage (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/leakchecker (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/mapbuffer (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/mounting (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/runtimescheduler (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/scheduler (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/telemetry (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/templateprocessor (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/textlayoutmanager (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) + - React-Fabric/config (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/core (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/debug_core (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/debug_renderer (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/imagemanager (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - React-RCTImage (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/leakchecker (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/mapbuffer (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/mounting (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/runtimescheduler (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/scheduler (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/telemetry (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/templateprocessor (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/textlayoutmanager (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) - React-Fabric/uimanager - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/uimanager (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-Fabric/utils (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 0.71.12) - - RCTTypeSafety (= 0.71.12) - - React-graphics (= 0.71.12) - - React-jsi (= 0.71.12) - - React-jsiexecutor (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-graphics (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - React-Core/Default (= 0.71.12) - - React-hermes (0.71.12): + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/uimanager (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-Fabric/utils (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.15) + - RCTTypeSafety (= 0.71.15) + - React-graphics (= 0.71.15) + - React-jsi (= 0.71.15) + - React-jsiexecutor (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-graphics (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - React-Core/Default (= 0.71.15) + - React-hermes (0.71.15): - DoubleConversion - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - RCT-Folly/Futures (= 2021.07.22.00) - - React-cxxreact (= 0.71.12) + - React-cxxreact (= 0.71.15) - React-jsi - - React-jsiexecutor (= 0.71.12) - - React-jsinspector (= 0.71.12) - - React-perflogger (= 0.71.12) - - React-jsi (0.71.12): + - React-jsiexecutor (= 0.71.15) + - React-jsinspector (= 0.71.15) + - React-perflogger (= 0.71.15) + - React-jsi (0.71.15): - boost (= 1.76.0) - DoubleConversion - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-jsiexecutor (0.71.12): + - React-jsiexecutor (0.71.15): - DoubleConversion - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-cxxreact (= 0.71.12) - - React-jsi (= 0.71.12) - - React-perflogger (= 0.71.12) - - React-jsinspector (0.71.12) - - React-logger (0.71.12): + - React-cxxreact (= 0.71.15) + - React-jsi (= 0.71.15) + - React-perflogger (= 0.71.15) + - React-jsinspector (0.71.15) + - React-logger (0.71.15): - glog - - react-native-video (6.0.0-alpha.6): + - react-native-video (6.0.0-beta.4): - React-Core - - react-native-video/Video (= 6.0.0-alpha.6) - - react-native-video/Video (6.0.0-alpha.6): + - react-native-video/Video (= 6.0.0-beta.4) + - react-native-video/Video (6.0.0-beta.4): - PromisesSwift - React-Core - - React-perflogger (0.71.12) - - React-RCTActionSheet (0.71.12): - - React-Core/RCTActionSheetHeaders (= 0.71.12) - - React-RCTAnimation (0.71.12): + - React-perflogger (0.71.15) + - React-RCTActionSheet (0.71.15): + - React-Core/RCTActionSheetHeaders (= 0.71.15) + - React-RCTAnimation (0.71.15): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.71.12) - - React-Codegen (= 0.71.12) - - React-Core/RCTAnimationHeaders (= 0.71.12) - - React-jsi (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-RCTAppDelegate (0.71.12): + - RCTTypeSafety (= 0.71.15) + - React-Codegen (= 0.71.15) + - React-Core/RCTAnimationHeaders (= 0.71.15) + - React-jsi (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-RCTAppDelegate (0.71.15): - RCT-Folly - RCTRequired - RCTTypeSafety @@ -683,80 +683,80 @@ PODS: - React-graphics - React-RCTFabric - ReactCommon/turbomodule/core - - React-RCTBlob (0.71.12): + - React-RCTBlob (0.71.15): - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-Codegen (= 0.71.12) - - React-Core/RCTBlobHeaders (= 0.71.12) - - React-Core/RCTWebSocket (= 0.71.12) - - React-jsi (= 0.71.12) - - React-RCTNetwork (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-RCTFabric (0.71.12): - - RCT-Folly/Fabric (= 2021.07.22.00) - - React-Core (= 0.71.12) - - React-Fabric (= 0.71.12) - - React-RCTImage (= 0.71.12) - - React-RCTImage (0.71.12): + - React-Codegen (= 0.71.15) + - React-Core/RCTBlobHeaders (= 0.71.15) + - React-Core/RCTWebSocket (= 0.71.15) + - React-jsi (= 0.71.15) + - React-RCTNetwork (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-RCTFabric (0.71.15): + - RCT-Folly/Fabric (= 2021.07.22.00) + - React-Core (= 0.71.15) + - React-Fabric (= 0.71.15) + - React-RCTImage (= 0.71.15) + - React-RCTImage (0.71.15): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.71.12) - - React-Codegen (= 0.71.12) - - React-Core/RCTImageHeaders (= 0.71.12) - - React-jsi (= 0.71.12) - - React-RCTNetwork (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-RCTLinking (0.71.12): - - React-Codegen (= 0.71.12) - - React-Core/RCTLinkingHeaders (= 0.71.12) - - React-jsi (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-RCTNetwork (0.71.12): + - RCTTypeSafety (= 0.71.15) + - React-Codegen (= 0.71.15) + - React-Core/RCTImageHeaders (= 0.71.15) + - React-jsi (= 0.71.15) + - React-RCTNetwork (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-RCTLinking (0.71.15): + - React-Codegen (= 0.71.15) + - React-Core/RCTLinkingHeaders (= 0.71.15) + - React-jsi (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-RCTNetwork (0.71.15): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.71.12) - - React-Codegen (= 0.71.12) - - React-Core/RCTNetworkHeaders (= 0.71.12) - - React-jsi (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-RCTSettings (0.71.12): + - RCTTypeSafety (= 0.71.15) + - React-Codegen (= 0.71.15) + - React-Core/RCTNetworkHeaders (= 0.71.15) + - React-jsi (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-RCTSettings (0.71.15): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.71.12) - - React-Codegen (= 0.71.12) - - React-Core/RCTSettingsHeaders (= 0.71.12) - - React-jsi (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-RCTText (0.71.12): - - React-Core/RCTTextHeaders (= 0.71.12) - - React-RCTVibration (0.71.12): + - RCTTypeSafety (= 0.71.15) + - React-Codegen (= 0.71.15) + - React-Core/RCTSettingsHeaders (= 0.71.15) + - React-jsi (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-RCTText (0.71.15): + - React-Core/RCTTextHeaders (= 0.71.15) + - React-RCTVibration (0.71.15): - RCT-Folly (= 2021.07.22.00) - - React-Codegen (= 0.71.12) - - React-Core/RCTVibrationHeaders (= 0.71.12) - - React-jsi (= 0.71.12) - - ReactCommon/turbomodule/core (= 0.71.12) - - React-rncore (0.71.12) - - React-runtimeexecutor (0.71.12): - - React-jsi (= 0.71.12) - - ReactCommon/turbomodule/bridging (0.71.12): + - React-Codegen (= 0.71.15) + - React-Core/RCTVibrationHeaders (= 0.71.15) + - React-jsi (= 0.71.15) + - ReactCommon/turbomodule/core (= 0.71.15) + - React-rncore (0.71.15) + - React-runtimeexecutor (0.71.15): + - React-jsi (= 0.71.15) + - ReactCommon/turbomodule/bridging (0.71.15): - DoubleConversion - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-callinvoker (= 0.71.12) - - React-Core (= 0.71.12) - - React-cxxreact (= 0.71.12) - - React-jsi (= 0.71.12) - - React-logger (= 0.71.12) - - React-perflogger (= 0.71.12) - - ReactCommon/turbomodule/core (0.71.12): + - React-callinvoker (= 0.71.15) + - React-Core (= 0.71.15) + - React-cxxreact (= 0.71.15) + - React-jsi (= 0.71.15) + - React-logger (= 0.71.15) + - React-perflogger (= 0.71.15) + - ReactCommon/turbomodule/core (0.71.15): - DoubleConversion - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-callinvoker (= 0.71.12) - - React-Core (= 0.71.12) - - React-cxxreact (= 0.71.12) - - React-jsi (= 0.71.12) - - React-logger (= 0.71.12) - - React-perflogger (= 0.71.12) + - React-callinvoker (= 0.71.15) + - React-Core (= 0.71.15) + - React-cxxreact (= 0.71.15) + - React-jsi (= 0.71.15) + - React-logger (= 0.71.15) + - React-perflogger (= 0.71.15) - SocketRocket (0.6.0) - Yoga (1.14.0) - YogaKit (1.18.1): @@ -930,11 +930,11 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - boost: 57d2868c099736d80fcd648bf211b4431e51a558 + boost: 7dcd2de282d72e344012f7d6564d024930a6a440 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 - FBLazyVector: 4eb7ee83e8d0ad7e20a829485295ff48823c4e4c - FBReactNativeSpec: be2df14ea53a93ca2cfcee55312669505eb90c5f + FBLazyVector: d06bbe89e3a89ee90c4deab1c84bf306ffa5ed37 + FBReactNativeSpec: 6fecc43741c2aed59c2bc6ba2c2f486014e03521 Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0 Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30 @@ -946,45 +946,45 @@ SPEC CHECKSUMS: FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b - hermes-engine: b60ebc812e0179a612d8146ac54730d533c804a2 + hermes-engine: 04437e4291ede4af0c76c25e7efd0eacb8fd25e5 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef PromisesSwift: cf9eb58666a43bbe007302226e510b16c1e10959 RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 - RCTRequired: 4db5e3e18b906377a502da5b358ff159ba4783ed - RCTTypeSafety: 6c1a8aed043050de0d537336c95cd1be7b66c272 - React: 214e77358d860a3ed707fede9088e7c00663a087 - React-callinvoker: 8fc1c79c26fbcadce2a5d4a3cb4b2ced2dec3436 - React-Codegen: d88c22066f9d685c3f67399aa595f7aa7e8ffc6b - React-Core: ea541085ca5be10b2be289c7d82eba368b5c4900 - React-CoreModules: d9680e1d551eef1dd764df736a473cf25f701070 - React-cxxreact: 0792e80e291d086b2cf588410f6bc6e752bc1d83 - React-Fabric: 223723f622a7cb4f77741a3a01fa91f66963aa18 - React-graphics: fa303eb6c3b52de9a8a9e38c7aab022b1ce6d3d4 - React-hermes: 0b1bba58112cb7421f1166d527a1a05489f48dbc - React-jsi: 1e41088515c4273ef5b118575337df4671851430 - React-jsiexecutor: 509cd947c28834614808ce056ee8eb700a0662aa - React-jsinspector: ec4dcbfb1f4e72f04f826a0301eceee5fa7ca540 - React-logger: 35538accacf2583693fbc3ee8b53e69a1776fcee - react-native-video: fee89269ad07556d960721f3b62e39be6ace3c90 - React-perflogger: 75b0e25075c67565a830985f3c373e2eae5389e0 - React-RCTActionSheet: a0c3e916b327e297d124d9ebe8b0c721840ee04d - React-RCTAnimation: 3da7025801d7bf0f8cfd94574d6278d5b82a8b88 - React-RCTAppDelegate: 2ef2a2b0f14b0b8e2ed91f88084801fadee5dee6 - React-RCTBlob: 53252ebabe7777fd1c440a34546c64e16b162908 - React-RCTFabric: 7667a890d204af8a42683133250251e698c67e5c - React-RCTImage: e230761bd34d71362dd8b3d51b5cd72674935aa0 - React-RCTLinking: 3294b1b540005628168e5a341963b0eddc3932e8 - React-RCTNetwork: 00c6b2215e54a9fb015c53a5e02b0a852dbb8568 - React-RCTSettings: 2e7e4964f45e9b24c6c32ad30b6ab2ef4a7e2ffc - React-RCTText: a9c712b13cab90e1432e0ad113edc8bdbc691248 - React-RCTVibration: a283fefb8cc29d9740a7ff2e87f72ad10f25a433 - React-rncore: 1809ecfc14066404da300c0d950876bf95852f87 - React-runtimeexecutor: 7902246857a4ead4166869e6c42d4df329ff721d - ReactCommon: a6d1c76b9e10b439e41db225263341240e1cda9f + RCTRequired: 4ce9da4fa2f8a134f62c70e4ab9d971b9d640f41 + RCTTypeSafety: decfec2884f0c523f799600d2b6105cdc15e13db + React: ca22a0b3f199b6acac95416ef7eb96cc84a55103 + React-callinvoker: 366d4449bc2901e89da3f30c6d203c491d060350 + React-Codegen: 6fe71a7e025aa51e73b66ebb092d59a2a7701bae + React-Core: 169395096d2c22872e22cd74e3694a4b041cce76 + React-CoreModules: 8c2a970d9fd778e6016b9297f2c2dddbe78b04ec + React-cxxreact: e61b3e92887bb8fc241326b83d667953ff732923 + React-Fabric: f4ddd27dc414581018db9cbdd362c80e77b08eca + React-graphics: 516c3bb35198e4a2531fd52ab6cfc681dad71874 + React-hermes: 476b93736605b457d1bc390336656c94460205b7 + React-jsi: 9fe8766963aa3aea90bbd477ea63255eb847d404 + React-jsiexecutor: e0cde8d57cee18097b3d2b1bf6404ad25dd8d33b + React-jsinspector: 4ade58a6a355d97a53f847543b14f4cb5033cb70 + React-logger: 56699550750c013096a11dce3bc996e7dd583835 + react-native-video: 6078b448c21630b0a2937436527ad54fd2a1fdd8 + React-perflogger: 0cc42978a483a47f3696171dac2e7033936fc82d + React-RCTActionSheet: ea922b476d24f6d40b8e02ac3228412bd3637468 + React-RCTAnimation: 7be2c148398eaa5beac950b2b5ec7102389ec3ad + React-RCTAppDelegate: dc57448e65541509565b59518e8a81e30ae69bd7 + React-RCTBlob: c1e1e53b334f36b3311c3206036c99f4e5406cdf + React-RCTFabric: 42e8e9067f73fdb2e9d12f0b09003cd49d3da139 + React-RCTImage: 4a2cd71dd8c1954cfab50e244b269d47bdcc76da + React-RCTLinking: c8ff9fe7f5741afc05894c7da4a0d2bd1458f247 + React-RCTNetwork: 93c329744baa8c04057a5a29b790618e0c2a6a68 + React-RCTSettings: bcd09cd3ee26967bdfbc8af174404b8ffabfbc3c + React-RCTText: c525eb78cfe9489f130fa69004ff081a5ae33e06 + React-RCTVibration: a97783e3645ddf852e34da2e015656e309f3a083 + React-rncore: 0fc98082b749bad91dbb7a4bca9cb53386477c81 + React-runtimeexecutor: 8f2ddd9db7874ec7de84f5c55d73aeaaf82908e2 + ReactCommon: 309d965cb51f058d07dea65bc04dcf462911f0a4 SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 - Yoga: 39310a10944fc864a7550700de349183450f8aaa + Yoga: 68c9c592c3e80ec37ff28db20eedb13d84aae5df YogaKit: f782866e155069a2cca2517aafea43200b01fd5a PODFILE CHECKSUM: 780eb8fa466e7a1ad2e9200598bc65585b637433 From 25f046ae6c8aec22b9a57ce68d45534e42af145d Mon Sep 17 00:00:00 2001 From: yungblud Date: Fri, 19 Jan 2024 13:33:21 +0900 Subject: [PATCH 05/28] feat: implemented codegen config on package.json --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 03412c3e92..a8711fccd7 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,8 @@ "release": "release-it", "test": "echo no test available", "check-ios": "scripts/swift-format.sh && scripts/swift-lint.sh && scripts/clang-format.sh", - "check-android": "scripts/kotlin-lint.sh" + "check-android": "scripts/kotlin-lint.sh", + "codegen": "node ./node_modules/react-native/scripts/generate-codegen-artifacts.js --path ./ ./output" }, "files": [ "android", @@ -67,6 +68,6 @@ "codegenConfig": { "name": "RNCVideo", "type": "components", - "jsSrcsDir": "src" + "jsSrcsDir": "./src/specs" } } From 84e06a3a97b1a8132391117f8839401084f6daea Mon Sep 17 00:00:00 2001 From: yungblud Date: Fri, 19 Jan 2024 13:39:50 +0900 Subject: [PATCH 06/28] feat: implemented codegen of specs/VideoNativeComponent --- src/specs/VideoNativeComponent.ts | 554 ++++++++++++++++++++---------- 1 file changed, 368 insertions(+), 186 deletions(-) diff --git a/src/specs/VideoNativeComponent.ts b/src/specs/VideoNativeComponent.ts index 2ef0403eaa..e925febe89 100644 --- a/src/specs/VideoNativeComponent.ts +++ b/src/specs/VideoNativeComponent.ts @@ -1,18 +1,24 @@ +/* eslint-disable @typescript-eslint/ban-types */ +import type {HostComponent, ViewProps} from 'react-native'; +import {NativeModules} from 'react-native'; +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; import type { - HostComponent, - NativeSyntheticEvent, - ViewProps, -} from 'react-native'; -import {NativeModules, requireNativeComponent} from 'react-native'; -import type ResizeMode from '../types/ResizeMode'; -import type FilterType from '../types/FilterType'; -import type Orientation from '../types/Orientation'; -import type {AdEvent, EnumValues, OnTextTracksTypeData} from '../types'; + DirectEventHandler, + Double, + Float, + Int32, + WithDefault, +} from 'react-native/Libraries/Types/CodegenTypes'; // -------- There are types for native component (future codegen) -------- // if you are looking for types for react component, see src/types/video.ts -type Headers = Record; +type Headers = ReadonlyArray< + Readonly<{ + key: string; + value: string; + }> +>; type VideoSrc = Readonly<{ uri?: string; @@ -20,12 +26,12 @@ type VideoSrc = Readonly<{ isAsset?: boolean; shouldCache?: boolean; type?: string; - mainVer?: number; - patchVer?: number; + mainVer?: Int32; + patchVer?: Int32; requestHeaders?: Headers; - startPosition?: number; - cropStart?: number; - cropEnd?: number; + startPosition?: Float; + cropStart?: Float; + cropEnd?: Float; title?: string; subtitle?: string; description?: string; @@ -50,7 +56,10 @@ export type Filter = | 'CIPhotoEffectTransfer' | 'CISepiaTone'; -export type DRMType = 'widevine' | 'playready' | 'clearkey' | 'fairplay'; +export type DRMType = WithDefault< + 'widevine' | 'playready' | 'clearkey' | 'fairplay', + 'widevine' +>; type DebugConfig = Readonly<{ enable?: boolean; @@ -76,59 +85,70 @@ type TextTracks = ReadonlyArray< }> >; -type TextTrackType = 'system' | 'disabled' | 'title' | 'language' | 'index'; +type TextTrackType = WithDefault< + 'system' | 'disabled' | 'title' | 'language' | 'index', + 'system' +>; type SelectedTextTrack = Readonly<{ - type: TextTrackType; - value?: string | number; + type?: TextTrackType; + value?: string; }>; -type AudioTrackType = 'system' | 'disabled' | 'title' | 'language' | 'index'; +type AudioTrackType = WithDefault< + 'system' | 'disabled' | 'title' | 'language' | 'index', + 'system' +>; type SelectedAudioTrack = Readonly<{ - type: AudioTrackType; - value?: string | number; + type?: AudioTrackType; + value?: string; }>; export type Seek = Readonly<{ - time: number; - tolerance?: number; + time: Float; + tolerance?: Float; }>; type BufferConfig = Readonly<{ - minBufferMs?: number; - maxBufferMs?: number; - bufferForPlaybackMs?: number; - bufferForPlaybackAfterRebufferMs?: number; - maxHeapAllocationPercent?: number; - minBackBufferMemoryReservePercent?: number; - minBufferMemoryReservePercent?: number; + minBufferMs?: Float; + maxBufferMs?: Float; + bufferForPlaybackMs?: Float; + bufferForPlaybackAfterRebufferMs?: Float; + maxHeapAllocationPercent?: Float; + minBackBufferMemoryReservePercent?: Float; + minBufferMemoryReservePercent?: Float; }>; +type VideoTrackType = WithDefault< + 'auto' | 'disabled' | 'resolution' | 'index', + 'auto' +>; + type SelectedVideoTrack = Readonly<{ - type: 'auto' | 'disabled' | 'resolution' | 'index'; - value?: number; + type?: VideoTrackType; + value?: Int32; }>; type SubtitleStyle = Readonly<{ - fontSize?: number; - paddingTop?: number; - paddingBottom?: number; - paddingLeft?: number; - paddingRight?: number; + fontSize?: Float; + paddingTop?: WithDefault; + paddingBottom?: WithDefault; + paddingLeft?: WithDefault; + paddingRight?: WithDefault; }>; export type OnLoadData = Readonly<{ - currentTime: number; - duration: number; + currentTime: Float; + duration: Float; naturalSize: Readonly<{ - width: number; - height: number; - orientation: Orientation; + width: Float; + height: Float; + orientation: WithDefault<'landscape' | 'portrait', 'landscape'>; }>; -}> & - OnAudioTracksData & - OnTextTracksData; + audioTracks: Readonly<{}>; + textTracks: Readonly<{}>; +}>; export type OnLoadStartData = Readonly<{ isNetwork: boolean; @@ -137,28 +157,28 @@ export type OnLoadStartData = Readonly<{ }>; export type OnVideoAspectRatioData = Readonly<{ - width: number; - height: number; + width: Float; + height: Float; }>; export type OnBufferData = Readonly<{isBuffering: boolean}>; export type OnProgressData = Readonly<{ - currentTime: number; - playableDuration: number; - seekableDuration: number; + currentTime: Float; + playableDuration: Float; + seekableDuration: Float; }>; export type OnBandwidthUpdateData = Readonly<{ - bitrate: number; - width?: number; - height?: number; - trackId?: number; + bitrate: Int32; + width?: Float; + height?: Float; + trackId?: Int32; }>; export type OnSeekData = Readonly<{ - currentTime: number; - seekTime: number; + currentTime: Float; + seekTime: Float; }>; export type OnPlaybackStateChangedData = Readonly<{ @@ -166,61 +186,80 @@ export type OnPlaybackStateChangedData = Readonly<{ }>; export type OnTimedMetadataData = Readonly<{ - metadata: ReadonlyArray< - Readonly<{ - value?: string; - identifier: string; - }> - >; + metadata: Readonly<{}>; }>; +// TODO fix type after RN 0.73 +// export type OnTimedMetadataData = Readonly<{ +// metadata: ReadonlyArray< +// Readonly<{ +// value?: string; +// identifier: string; +// }> +// >; +// }>; export type OnAudioTracksData = Readonly<{ - audioTracks: ReadonlyArray< - Readonly<{ - index: number; - title?: string; - language?: string; - bitrate?: number; - type?: string; - selected?: boolean; - }> - >; + audioTracks: Readonly<{}>; }>; +// TODO fix type after RN 0.73 +// export type OnAudioTracksData = Readonly<{ +// audioTracks: ReadonlyArray< +// Readonly<{ +// index: Int32; +// title?: string; +// language?: string; +// bitrate?: Float; +// type?: string; +// selected?: boolean; +// }> +// >; +// }>; + export type OnTextTracksData = Readonly<{ - textTracks: ReadonlyArray< - Readonly<{ - index: number; - title?: string; - language?: string; - /** - * iOS only supports VTT, Android supports all 3 - */ - type?: OnTextTracksTypeData; - selected?: boolean; - }> - >; + textTracks: Readonly<{}>; }>; +// TODO fix type after RN 0.73 +// export type OnTextTracksData = Readonly<{ +// textTracks: ReadonlyArray< +// Readonly<{ +// index: Int32; +// title?: string; +// language?: string; +// /** +// * iOS only supports VTT, Android supports all 3 +// */ +// type?: OnTextTracksTypeCodegenData; +// selected?: boolean; +// }> +// >; +// }>; + export type OnVideoTracksData = Readonly<{ - videoTracks: ReadonlyArray< - Readonly<{ - trackId: number; - codecs?: string; - width?: number; - height?: number; - bitrate?: number; - selected?: boolean; - }> - >; + videoTracks: Readonly<{}>; }>; +// TODO fix type after RN 0.73 +// export type OnVideoTracksData = Readonly<{ +// videoTracks: ReadonlyArray< +// Readonly<{ +// trackId: Int32; +// codecs?: string; +// width?: Float; +// height?: Float; +// bitrate?: Float; +// selected?: boolean; +// }> +// >; +// }>; + export type OnPlaybackData = Readonly<{ - playbackRate: number; + playbackRate: Float; }>; -export type onVolumeChangeData = Readonly<{ - volume: number; +export type OnVolumeChangeData = Readonly<{ + volume: Float; }>; export type OnExternalPlaybackChangeData = Readonly<{ @@ -238,26 +277,177 @@ export type OnPictureInPictureStatusChangedData = Readonly<{ }>; export type OnReceiveAdEventData = Readonly<{ - data?: Record; - event: AdEvent; + data?: {}; + event: WithDefault< + /** + * iOS only: Fired the first time each ad break ends. Applications must reenable seeking when this occurs (only used for dynamic ad insertion). + */ | 'AD_BREAK_ENDED' + /** + * Fires when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false. + */ + | 'AD_BREAK_READY' + /** + * iOS only: Fired first time each ad break begins playback. If an ad break is watched subsequent times this will not be fired. Applications must disable seeking when this occurs (only used for dynamic ad insertion). + */ + | 'AD_BREAK_STARTED' + /** + * Android only: Fires when the ad has stalled playback to buffer. + */ + | 'AD_BUFFERING' + /** + * Android only: Fires when the ad is ready to play without buffering, either at the beginning of the ad or after buffering completes. + */ + | 'AD_CAN_PLAY' + /** + * Android only: Fires when an ads list is loaded. + */ + | 'AD_METADATA' + /** + * iOS only: Fired every time the stream switches from advertising or slate to content. This will be fired even when an ad is played a second time or when seeking into an ad (only used for dynamic ad insertion). + */ + | 'AD_PERIOD_ENDED' + /** + * iOS only: Fired every time the stream switches from content to advertising or slate. This will be fired even when an ad is played a second time or when seeking into an ad (only used for dynamic ad insertion). + */ + | 'AD_PERIOD_STARTED' + /** + * Android only: Fires when the ad's current time value changes. The event `data` will be populated with an AdProgressData object. + */ + | 'AD_PROGRESS' + /** + * Fires when the ads manager is done playing all the valid ads in the ads response, or when the response doesn't return any valid ads. + */ + | 'ALL_ADS_COMPLETED' + /** + * Fires when the ad is clicked. + */ + | 'CLICK' + /** + * Fires when the ad completes playing. + */ + | 'COMPLETED' + /** + * Android only: Fires when content should be paused. This usually happens right before an ad is about to cover the content. + */ + | 'CONTENT_PAUSE_REQUESTED' + /** + * Android only: Fires when content should be resumed. This usually happens when an ad finishes or collapses. + */ + | 'CONTENT_RESUME_REQUESTED' + /** + * iOS only: Cuepoints changed for VOD stream (only used for dynamic ad insertion). + */ + | 'CUEPOINTS_CHANGED' + /** + * Android only: Fires when the ad's duration changes. + */ + | 'DURATION_CHANGE' + /** + * Fires when an error is encountered and the ad can't be played. + */ + | 'ERROR' + /** + * Fires when the ad playhead crosses first quartile. + */ + | 'FIRST_QUARTILE' + /** + * Android only: Fires when the impression URL has been pinged. + */ + | 'IMPRESSION' + /** + * Android only: Fires when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data. + */ + | 'INTERACTION' + /** + * Android only: Fires when the displayed ad changes from linear to nonlinear, or the reverse. + */ + | 'LINEAR_CHANGED' + /** + * Fires when ad data is available. + */ + | 'LOADED' + /** + * Fires when a non-fatal error is encountered. The user need not take any action since the SDK will continue with the same or next ad playback depending on the error situation. + */ + | 'LOG' + /** + * Fires when the ad playhead crosses midpoint. + */ + | 'MIDPOINT' + /** + * Fires when the ad is paused. + */ + | 'PAUSED' + /** + * Fires when the ad is resumed. + */ + | 'RESUMED' + /** + * Android only: Fires when the displayed ads skippable state is changed. + */ + | 'SKIPPABLE_STATE_CHANGED' + /** + * Fires when the ad is skipped by the user. + */ + | 'SKIPPED' + /** + * Fires when the ad starts playing. + */ + | 'STARTED' + /** + * iOS only: Stream request has loaded (only used for dynamic ad insertion). + */ + | 'STREAM_LOADED' + /** + * iOS only: Fires when the ad is tapped. + */ + | 'TAPPED' + /** + * Fires when the ad playhead crosses third quartile. + */ + | 'THIRD_QUARTILE' + /** + * iOS only: An unknown event has fired + */ + | 'UNKNOWN' + /** + * Android only: Fires when the ad is closed by the user. + */ + | 'USER_CLOSE' + /** + * Android only: Fires when the non-clickthrough portion of a video ad is clicked. + */ + | 'VIDEO_CLICKED' + /** + * Android only: Fires when a user clicks a video icon. + */ + | 'VIDEO_ICON_CLICKED' + /** + * Android only: Fires when the ad volume has changed. + */ + | 'VOLUME_CHANGED' + /** + * Android only: Fires when the ad volume has been muted. + */ + | 'VOLUME_MUTED', + 'AD_BREAK_ENDED' + >; }>; export type OnVideoErrorData = Readonly<{ - error: OnVideoErrorDataDetails; - target?: number; // ios -}>; - -export type OnVideoErrorDataDetails = Readonly<{ - errorString?: string; // android - errorException?: string; // android - errorStackTrace?: string; // android - errorCode?: string; // android - error?: string; // ios - code?: number; // ios - localizedDescription?: string; // ios - localizedFailureReason?: string; // ios - localizedRecoverySuggestion?: string; // ios - domain?: string; // ios + error: Readonly<{ + errorString?: string; // android + errorException?: string; // android + errorStackTrace?: string; // android + errorCode?: string; // android + error?: string; // ios + code?: Int32; // ios + localizedDescription?: string; // ios + localizedFailureReason?: string; // ios + localizedRecoverySuggestion?: string; // ios + domain?: string; // ios + }>; + target?: Int32; // ios }>; export type OnAudioFocusChangedData = Readonly<{ @@ -269,8 +459,8 @@ export interface VideoNativeProps extends ViewProps { drm?: Drm; adTagUrl?: string; allowsExternalPlayback?: boolean; // ios, true - maxBitRate?: number; - resizeMode?: EnumValues; + maxBitRate?: Float; + resizeMode?: WithDefault<'none' | 'contain' | 'cover' | 'stretch', 'none'>; repeat?: boolean; automaticallyWaitsToMinimizeStalling?: boolean; textTracks?: TextTracks; @@ -279,94 +469,86 @@ export interface VideoNativeProps extends ViewProps { paused?: boolean; muted?: boolean; controls?: boolean; - filter?: EnumValues; + filter?: WithDefault< + | '' + | 'CIColorInvert' + | 'CIColorMonochrome' + | 'CIColorPosterize' + | 'CIFalseColor' + | 'CIMaximumComponent' + | 'CIMinimumComponent' + | 'CIPhotoEffectChrome' + | 'CIPhotoEffectFade' + | 'CIPhotoEffectInstant' + | 'CIPhotoEffectMono' + | 'CIPhotoEffectNoir' + | 'CIPhotoEffectProcess' + | 'CIPhotoEffectTonal' + | 'CIPhotoEffectTransfer' + | 'CISepiaTone', + '' + >; filterEnabled?: boolean; - volume?: number; // default 1.0 + volume?: Float; // default 1.0 playInBackground?: boolean; preventsDisplaySleepDuringVideoPlayback?: boolean; - preferredForwardBufferDuration?: number; //ios, 0 + preferredForwardBufferDuration?: Float; //ios, 0 playWhenInactive?: boolean; // ios, false pictureInPicture?: boolean; // ios, false - ignoreSilentSwitch?: 'inherit' | 'ignore' | 'obey'; // ios, 'inherit' - mixWithOthers?: 'inherit' | 'mix' | 'duck'; // ios, 'inherit' - rate?: number; + ignoreSilentSwitch?: WithDefault<'inherit' | 'ignore' | 'obey', 'inherit'>; // ios, 'inherit' + mixWithOthers?: WithDefault<'inherit' | 'mix' | 'duck', 'inherit'>; // ios, 'inherit' + rate?: Float; fullscreen?: boolean; // ios, false fullscreenAutorotate?: boolean; - fullscreenOrientation?: 'all' | 'landscape' | 'portrait'; - progressUpdateInterval?: number; + fullscreenOrientation?: WithDefault<'all' | 'landscape' | 'portrait', 'all'>; + progressUpdateInterval?: Float; restoreUserInterfaceForPIPStopCompletionHandler?: boolean; localSourceEncryptionKeyScheme?: string; debug?: DebugConfig; - backBufferDurationMs?: number; // Android + backBufferDurationMs?: Int32; // Android bufferConfig?: BufferConfig; // Android - contentStartTime?: number; // Android - currentPlaybackTime?: number; // Android + contentStartTime?: Int32; // Android + currentPlaybackTime?: Double; // Android disableDisconnectError?: boolean; // Android focusable?: boolean; // Android hideShutterView?: boolean; // Android - minLoadRetryCount?: number; // Android + minLoadRetryCount?: Int32; // Android reportBandwidth?: boolean; //Android selectedVideoTrack?: SelectedVideoTrack; // android subtitleStyle?: SubtitleStyle; // android trackId?: string; // Android useTextureView?: boolean; // Android useSecureView?: boolean; // Android - onVideoLoad?: (event: NativeSyntheticEvent) => void; - onVideoLoadStart?: (event: NativeSyntheticEvent) => void; - onVideoAspectRatio?: ( - event: NativeSyntheticEvent, - ) => void; - onVideoBuffer?: (event: NativeSyntheticEvent) => void; - onVideoError?: (event: NativeSyntheticEvent) => void; - onVideoProgress?: (event: NativeSyntheticEvent) => void; - onVideoBandwidthUpdate?: ( - event: NativeSyntheticEvent, - ) => void; - onVideoSeek?: (event: NativeSyntheticEvent) => void; - onVideoEnd?: (event: NativeSyntheticEvent>) => void; // all - onVideoAudioBecomingNoisy?: ( - event: NativeSyntheticEvent>, - ) => void; - onVideoFullscreenPlayerWillPresent?: ( - event: NativeSyntheticEvent>, - ) => void; // ios, android - onVideoFullscreenPlayerDidPresent?: ( - event: NativeSyntheticEvent>, - ) => void; // ios, android - onVideoFullscreenPlayerWillDismiss?: ( - event: NativeSyntheticEvent>, - ) => void; // ios, android - onVideoFullscreenPlayerDidDismiss?: ( - event: NativeSyntheticEvent>, - ) => void; // ios, android - onReadyForDisplay?: (event: NativeSyntheticEvent>) => void; - onPlaybackRateChange?: (event: NativeSyntheticEvent) => void; // all - onVolumeChange?: (event: NativeSyntheticEvent) => void; // android, ios - onVideoExternalPlaybackChange?: ( - event: NativeSyntheticEvent, - ) => void; - onGetLicense?: (event: NativeSyntheticEvent) => void; - onPictureInPictureStatusChanged?: ( - event: NativeSyntheticEvent, - ) => void; - onRestoreUserInterfaceForPictureInPictureStop?: ( - event: NativeSyntheticEvent>, - ) => void; - onReceiveAdEvent?: ( - event: NativeSyntheticEvent, - ) => void; - onVideoPlaybackStateChanged?: ( - event: NativeSyntheticEvent, - ) => void; // android only - onVideoIdle?: (event: NativeSyntheticEvent) => void; // android only (nowhere in document, so do not use as props. just type declaration) - onAudioFocusChanged?: ( - event: NativeSyntheticEvent, - ) => void; // android only (nowhere in document, so do not use as props. just type declaration) - onTimedMetadata?: (event: NativeSyntheticEvent) => void; // ios, android - onAudioTracks?: (event: NativeSyntheticEvent) => void; // android - onTextTracks?: (event: NativeSyntheticEvent) => void; // android - onVideoTracks?: (event: NativeSyntheticEvent) => void; // android + onVideoLoad?: DirectEventHandler; + onVideoLoadStart?: DirectEventHandler; + onVideoAspectRatio?: DirectEventHandler; + onVideoBuffer?: DirectEventHandler; + onVideoError?: DirectEventHandler; + onVideoProgress?: DirectEventHandler; + onVideoBandwidthUpdate?: DirectEventHandler; + onVideoSeek?: DirectEventHandler; + onVideoEnd?: DirectEventHandler<{}>; // all + onVideoAudioBecomingNoisy?: DirectEventHandler<{}>; + onVideoFullscreenPlayerWillPresent?: DirectEventHandler<{}>; // ios, android + onVideoFullscreenPlayerDidPresent?: DirectEventHandler<{}>; // ios, android + onVideoFullscreenPlayerWillDismiss?: DirectEventHandler<{}>; // ios, android + onVideoFullscreenPlayerDidDismiss?: DirectEventHandler<{}>; // ios, android + onReadyForDisplay?: DirectEventHandler<{}>; + onPlaybackRateChange?: DirectEventHandler; // all + onVolumeChange?: DirectEventHandler; // android, ios + onVideoExternalPlaybackChange?: DirectEventHandler; + onGetLicense?: DirectEventHandler; + onPictureInPictureStatusChanged?: DirectEventHandler; + onRestoreUserInterfaceForPictureInPictureSto: DirectEventHandler<{}>; + onReceiveAdEvent?: DirectEventHandler; + onVideoPlaybackStateChanged?: DirectEventHandler; // android only + onVideoIdle?: DirectEventHandler<{}>; // android only (nowhere in document, so do not use as props. just type declaration) + onAudioFocusChanged?: DirectEventHandler; // android only (nowhere in document, so do not use as props. just type declaration) + onTimedMetadata?: DirectEventHandler; // ios, android + onAudioTracks?: DirectEventHandler; // android + onTextTracks?: DirectEventHandler; // android + onVideoTracks?: DirectEventHandler; // android } export type VideoComponentType = HostComponent; @@ -404,6 +586,6 @@ export const VideoManager = NativeModules.VideoManager as VideoManagerType; export const VideoDecoderProperties = NativeModules.VideoDecoderProperties as VideoDecoderPropertiesType; -export default requireNativeComponent( - 'RCTVideo', +export default codegenNativeComponent( + 'RNCVideo', ) as VideoComponentType; From aa03b540e82651c25db195dea23dbf53d772b964 Mon Sep 17 00:00:00 2001 From: yungblud Date: Fri, 19 Jan 2024 13:40:32 +0900 Subject: [PATCH 07/28] chore: removed not using type Filter --- src/specs/VideoNativeComponent.ts | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/specs/VideoNativeComponent.ts b/src/specs/VideoNativeComponent.ts index e925febe89..864c102f78 100644 --- a/src/specs/VideoNativeComponent.ts +++ b/src/specs/VideoNativeComponent.ts @@ -38,24 +38,6 @@ type VideoSrc = Readonly<{ customImageUri?: string; }>; -export type Filter = - | 'None' - | 'CIColorInvert' - | 'CIColorMonochrome' - | 'CIColorPosterize' - | 'CIFalseColor' - | 'CIMaximumComponent' - | 'CIMinimumComponent' - | 'CIPhotoEffectChrome' - | 'CIPhotoEffectFade' - | 'CIPhotoEffectInstant' - | 'CIPhotoEffectMono' - | 'CIPhotoEffectNoir' - | 'CIPhotoEffectProcess' - | 'CIPhotoEffectTonal' - | 'CIPhotoEffectTransfer' - | 'CISepiaTone'; - export type DRMType = WithDefault< 'widevine' | 'playready' | 'clearkey' | 'fairplay', 'widevine' From fc243b0ac5c565eda4886cd865c32ba4e812d7ff Mon Sep 17 00:00:00 2001 From: yungblud Date: Fri, 19 Jan 2024 13:42:45 +0900 Subject: [PATCH 08/28] feat: removed unnecessary export on codegen tyepes --- src/specs/VideoNativeComponent.ts | 50 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/specs/VideoNativeComponent.ts b/src/specs/VideoNativeComponent.ts index 864c102f78..b7fb0b7039 100644 --- a/src/specs/VideoNativeComponent.ts +++ b/src/specs/VideoNativeComponent.ts @@ -38,7 +38,7 @@ type VideoSrc = Readonly<{ customImageUri?: string; }>; -export type DRMType = WithDefault< +type DRMType = WithDefault< 'widevine' | 'playready' | 'clearkey' | 'fairplay', 'widevine' >; @@ -87,7 +87,7 @@ type SelectedAudioTrack = Readonly<{ value?: string; }>; -export type Seek = Readonly<{ +type Seek = Readonly<{ time: Float; tolerance?: Float; }>; @@ -120,7 +120,7 @@ type SubtitleStyle = Readonly<{ paddingRight?: WithDefault; }>; -export type OnLoadData = Readonly<{ +type OnLoadData = Readonly<{ currentTime: Float; duration: Float; naturalSize: Readonly<{ @@ -132,46 +132,46 @@ export type OnLoadData = Readonly<{ textTracks: Readonly<{}>; }>; -export type OnLoadStartData = Readonly<{ +type OnLoadStartData = Readonly<{ isNetwork: boolean; type: string; uri: string; }>; -export type OnVideoAspectRatioData = Readonly<{ +type OnVideoAspectRatioData = Readonly<{ width: Float; height: Float; }>; -export type OnBufferData = Readonly<{isBuffering: boolean}>; +type OnBufferData = Readonly<{isBuffering: boolean}>; -export type OnProgressData = Readonly<{ +type OnProgressData = Readonly<{ currentTime: Float; playableDuration: Float; seekableDuration: Float; }>; -export type OnBandwidthUpdateData = Readonly<{ +type OnBandwidthUpdateData = Readonly<{ bitrate: Int32; width?: Float; height?: Float; trackId?: Int32; }>; -export type OnSeekData = Readonly<{ +type OnSeekData = Readonly<{ currentTime: Float; seekTime: Float; }>; -export type OnPlaybackStateChangedData = Readonly<{ +type OnPlaybackStateChangedData = Readonly<{ isPlaying: boolean; }>; -export type OnTimedMetadataData = Readonly<{ +type OnTimedMetadataData = Readonly<{ metadata: Readonly<{}>; }>; // TODO fix type after RN 0.73 -// export type OnTimedMetadataData = Readonly<{ +// type OnTimedMetadataData = Readonly<{ // metadata: ReadonlyArray< // Readonly<{ // value?: string; @@ -180,7 +180,7 @@ export type OnTimedMetadataData = Readonly<{ // >; // }>; -export type OnAudioTracksData = Readonly<{ +type OnAudioTracksData = Readonly<{ audioTracks: Readonly<{}>; }>; @@ -198,12 +198,12 @@ export type OnAudioTracksData = Readonly<{ // >; // }>; -export type OnTextTracksData = Readonly<{ +type OnTextTracksData = Readonly<{ textTracks: Readonly<{}>; }>; // TODO fix type after RN 0.73 -// export type OnTextTracksData = Readonly<{ +// type OnTextTracksData = Readonly<{ // textTracks: ReadonlyArray< // Readonly<{ // index: Int32; @@ -218,12 +218,12 @@ export type OnTextTracksData = Readonly<{ // >; // }>; -export type OnVideoTracksData = Readonly<{ +type OnVideoTracksData = Readonly<{ videoTracks: Readonly<{}>; }>; // TODO fix type after RN 0.73 -// export type OnVideoTracksData = Readonly<{ +// type OnVideoTracksData = Readonly<{ // videoTracks: ReadonlyArray< // Readonly<{ // trackId: Int32; @@ -236,29 +236,29 @@ export type OnVideoTracksData = Readonly<{ // >; // }>; -export type OnPlaybackData = Readonly<{ +type OnPlaybackData = Readonly<{ playbackRate: Float; }>; -export type OnVolumeChangeData = Readonly<{ +type OnVolumeChangeData = Readonly<{ volume: Float; }>; -export type OnExternalPlaybackChangeData = Readonly<{ +type OnExternalPlaybackChangeData = Readonly<{ isExternalPlaybackActive: boolean; }>; -export type OnGetLicenseData = Readonly<{ +type OnGetLicenseData = Readonly<{ licenseUrl: string; contentId: string; spcBase64: string; }>; -export type OnPictureInPictureStatusChangedData = Readonly<{ +type OnPictureInPictureStatusChangedData = Readonly<{ isActive: boolean; }>; -export type OnReceiveAdEventData = Readonly<{ +type OnReceiveAdEventData = Readonly<{ data?: {}; event: WithDefault< /** @@ -416,7 +416,7 @@ export type OnReceiveAdEventData = Readonly<{ >; }>; -export type OnVideoErrorData = Readonly<{ +type OnVideoErrorData = Readonly<{ error: Readonly<{ errorString?: string; // android errorException?: string; // android @@ -432,7 +432,7 @@ export type OnVideoErrorData = Readonly<{ target?: Int32; // ios }>; -export type OnAudioFocusChangedData = Readonly<{ +type OnAudioFocusChangedData = Readonly<{ hasAudioFocus: boolean; }>; From 6deb74bf06fa5bbc402f8546da28396e2fa557cd Mon Sep 17 00:00:00 2001 From: yungblud Date: Fri, 19 Jan 2024 13:47:31 +0900 Subject: [PATCH 09/28] Revert "feat: removed unnecessary export on codegen tyepes" This reverts commit fc243b0ac5c565eda4886cd865c32ba4e812d7ff. --- src/specs/VideoNativeComponent.ts | 50 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/specs/VideoNativeComponent.ts b/src/specs/VideoNativeComponent.ts index b7fb0b7039..864c102f78 100644 --- a/src/specs/VideoNativeComponent.ts +++ b/src/specs/VideoNativeComponent.ts @@ -38,7 +38,7 @@ type VideoSrc = Readonly<{ customImageUri?: string; }>; -type DRMType = WithDefault< +export type DRMType = WithDefault< 'widevine' | 'playready' | 'clearkey' | 'fairplay', 'widevine' >; @@ -87,7 +87,7 @@ type SelectedAudioTrack = Readonly<{ value?: string; }>; -type Seek = Readonly<{ +export type Seek = Readonly<{ time: Float; tolerance?: Float; }>; @@ -120,7 +120,7 @@ type SubtitleStyle = Readonly<{ paddingRight?: WithDefault; }>; -type OnLoadData = Readonly<{ +export type OnLoadData = Readonly<{ currentTime: Float; duration: Float; naturalSize: Readonly<{ @@ -132,46 +132,46 @@ type OnLoadData = Readonly<{ textTracks: Readonly<{}>; }>; -type OnLoadStartData = Readonly<{ +export type OnLoadStartData = Readonly<{ isNetwork: boolean; type: string; uri: string; }>; -type OnVideoAspectRatioData = Readonly<{ +export type OnVideoAspectRatioData = Readonly<{ width: Float; height: Float; }>; -type OnBufferData = Readonly<{isBuffering: boolean}>; +export type OnBufferData = Readonly<{isBuffering: boolean}>; -type OnProgressData = Readonly<{ +export type OnProgressData = Readonly<{ currentTime: Float; playableDuration: Float; seekableDuration: Float; }>; -type OnBandwidthUpdateData = Readonly<{ +export type OnBandwidthUpdateData = Readonly<{ bitrate: Int32; width?: Float; height?: Float; trackId?: Int32; }>; -type OnSeekData = Readonly<{ +export type OnSeekData = Readonly<{ currentTime: Float; seekTime: Float; }>; -type OnPlaybackStateChangedData = Readonly<{ +export type OnPlaybackStateChangedData = Readonly<{ isPlaying: boolean; }>; -type OnTimedMetadataData = Readonly<{ +export type OnTimedMetadataData = Readonly<{ metadata: Readonly<{}>; }>; // TODO fix type after RN 0.73 -// type OnTimedMetadataData = Readonly<{ +// export type OnTimedMetadataData = Readonly<{ // metadata: ReadonlyArray< // Readonly<{ // value?: string; @@ -180,7 +180,7 @@ type OnTimedMetadataData = Readonly<{ // >; // }>; -type OnAudioTracksData = Readonly<{ +export type OnAudioTracksData = Readonly<{ audioTracks: Readonly<{}>; }>; @@ -198,12 +198,12 @@ type OnAudioTracksData = Readonly<{ // >; // }>; -type OnTextTracksData = Readonly<{ +export type OnTextTracksData = Readonly<{ textTracks: Readonly<{}>; }>; // TODO fix type after RN 0.73 -// type OnTextTracksData = Readonly<{ +// export type OnTextTracksData = Readonly<{ // textTracks: ReadonlyArray< // Readonly<{ // index: Int32; @@ -218,12 +218,12 @@ type OnTextTracksData = Readonly<{ // >; // }>; -type OnVideoTracksData = Readonly<{ +export type OnVideoTracksData = Readonly<{ videoTracks: Readonly<{}>; }>; // TODO fix type after RN 0.73 -// type OnVideoTracksData = Readonly<{ +// export type OnVideoTracksData = Readonly<{ // videoTracks: ReadonlyArray< // Readonly<{ // trackId: Int32; @@ -236,29 +236,29 @@ type OnVideoTracksData = Readonly<{ // >; // }>; -type OnPlaybackData = Readonly<{ +export type OnPlaybackData = Readonly<{ playbackRate: Float; }>; -type OnVolumeChangeData = Readonly<{ +export type OnVolumeChangeData = Readonly<{ volume: Float; }>; -type OnExternalPlaybackChangeData = Readonly<{ +export type OnExternalPlaybackChangeData = Readonly<{ isExternalPlaybackActive: boolean; }>; -type OnGetLicenseData = Readonly<{ +export type OnGetLicenseData = Readonly<{ licenseUrl: string; contentId: string; spcBase64: string; }>; -type OnPictureInPictureStatusChangedData = Readonly<{ +export type OnPictureInPictureStatusChangedData = Readonly<{ isActive: boolean; }>; -type OnReceiveAdEventData = Readonly<{ +export type OnReceiveAdEventData = Readonly<{ data?: {}; event: WithDefault< /** @@ -416,7 +416,7 @@ type OnReceiveAdEventData = Readonly<{ >; }>; -type OnVideoErrorData = Readonly<{ +export type OnVideoErrorData = Readonly<{ error: Readonly<{ errorString?: string; // android errorException?: string; // android @@ -432,7 +432,7 @@ type OnVideoErrorData = Readonly<{ target?: Int32; // ios }>; -type OnAudioFocusChangedData = Readonly<{ +export type OnAudioFocusChangedData = Readonly<{ hasAudioFocus: boolean; }>; From 49d3f593b7794bfecfee11700a065701e44e3937 Mon Sep 17 00:00:00 2001 From: yungblud Date: Fri, 19 Jan 2024 14:57:59 +0900 Subject: [PATCH 10/28] refactor: fixed types on Video component and modified types with codegen types --- src/Video.tsx | 57 +++++----- src/specs/VideoNativeComponent.ts | 34 +++--- src/types/events.ts | 174 ++++-------------------------- src/types/video.ts | 37 ++----- src/utils.ts | 8 ++ 5 files changed, 77 insertions(+), 233 deletions(-) diff --git a/src/Video.tsx b/src/Video.tsx index 57e6539211..06da154026 100644 --- a/src/Video.tsx +++ b/src/Video.tsx @@ -9,33 +9,36 @@ 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 OnTextTracksData, + type OnTimedMetadataData, + type OnVideoAspectRatioData, + type OnVideoErrorData, + type OnVideoTracksData, type VideoComponentType, + type VideoSrc, } from './specs/VideoNativeComponent'; import type {StyleProp, ImageStyle, NativeSyntheticEvent} from 'react-native'; -import {getReactTag, resolveAssetSourceForVideo} from './utils'; +import { + generateHeaderForNative, + getReactTag, + resolveAssetSourceForVideo, +} from './utils'; import {VideoManager} from './specs/VideoNativeComponent'; -import type { - OnAudioFocusChangedData, - OnAudioTracksData, - OnBandwidthUpdateData, - OnBufferData, - OnExternalPlaybackChangeData, - OnGetLicenseData, - OnLoadData, - OnLoadStartData, - OnPictureInPictureStatusChangedData, - OnPlaybackStateChangedData, - OnProgressData, - OnReceiveAdEventData, - OnSeekData, - OnTextTracksData, - OnTimedMetadataData, - OnVideoAspectRatioData, - OnVideoErrorData, - OnVideoTracksData, - ReactVideoProps, -} from './types'; +import type {ReactVideoProps} from './types/video'; export type VideoSaveData = { uri: string; @@ -118,11 +121,7 @@ const Video = forwardRef( [posterResizeMode], ); - const src = useMemo(() => { - if (!source) { - return undefined; - } - + const src = useMemo(() => { const resolvedSource = resolveAssetSourceForVideo(source); let uri = resolvedSource.uri || ''; if (uri && uri.match(/^\//)) { @@ -147,7 +146,7 @@ const Video = forwardRef( 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, @@ -166,7 +165,7 @@ const Video = forwardRef( return { type: drm.type, licenseServer: drm.licenseServer, - headers: drm.headers, + headers: generateHeaderForNative(drm.headers), contentId: drm.contentId, certificateUrl: drm.certificateUrl, base64Certificate: drm.base64Certificate, diff --git a/src/specs/VideoNativeComponent.ts b/src/specs/VideoNativeComponent.ts index 864c102f78..36441ce6bd 100644 --- a/src/specs/VideoNativeComponent.ts +++ b/src/specs/VideoNativeComponent.ts @@ -20,7 +20,7 @@ type Headers = ReadonlyArray< }> >; -type VideoSrc = Readonly<{ +export type VideoSrc = Readonly<{ uri?: string; isNetwork?: boolean; isAsset?: boolean; @@ -67,23 +67,13 @@ type TextTracks = ReadonlyArray< }> >; -type TextTrackType = WithDefault< +type SelectedTrack = WithDefault< 'system' | 'disabled' | 'title' | 'language' | 'index', 'system' >; -type SelectedTextTrack = Readonly<{ - type?: TextTrackType; - value?: string; -}>; - -type AudioTrackType = WithDefault< - 'system' | 'disabled' | 'title' | 'language' | 'index', - 'system' ->; - -type SelectedAudioTrack = Readonly<{ - type?: AudioTrackType; +export type SelectedTrackType = Readonly<{ + type?: SelectedTrack; value?: string; }>; @@ -102,13 +92,13 @@ type BufferConfig = Readonly<{ minBufferMemoryReservePercent?: Float; }>; -type VideoTrackType = WithDefault< +type SelectedVideoTrack = WithDefault< 'auto' | 'disabled' | 'resolution' | 'index', 'auto' >; -type SelectedVideoTrack = Readonly<{ - type?: VideoTrackType; +export type SelectedVideoTrackType = Readonly<{ + type?: SelectedVideoTrack; value?: Int32; }>; @@ -212,7 +202,7 @@ export type OnTextTracksData = Readonly<{ // /** // * iOS only supports VTT, Android supports all 3 // */ -// type?: OnTextTracksTypeCodegenData; +// type?: WithDefault<'srt' | 'ttml' | 'vtt', 'srt'>; // selected?: boolean; // }> // >; @@ -446,8 +436,8 @@ export interface VideoNativeProps extends ViewProps { repeat?: boolean; automaticallyWaitsToMinimizeStalling?: boolean; textTracks?: TextTracks; - selectedTextTrack?: SelectedTextTrack; - selectedAudioTrack?: SelectedAudioTrack; + selectedTextTrack?: SelectedTrackType; + selectedAudioTrack?: SelectedTrackType; paused?: boolean; muted?: boolean; controls?: boolean; @@ -497,7 +487,7 @@ export interface VideoNativeProps extends ViewProps { hideShutterView?: boolean; // Android minLoadRetryCount?: Int32; // Android reportBandwidth?: boolean; //Android - selectedVideoTrack?: SelectedVideoTrack; // android + selectedVideoTrack?: SelectedVideoTrackType; // android subtitleStyle?: SubtitleStyle; // android trackId?: string; // Android useTextureView?: boolean; // Android @@ -522,7 +512,7 @@ export interface VideoNativeProps extends ViewProps { onVideoExternalPlaybackChange?: DirectEventHandler; onGetLicense?: DirectEventHandler; onPictureInPictureStatusChanged?: DirectEventHandler; - onRestoreUserInterfaceForPictureInPictureSto: DirectEventHandler<{}>; + onRestoreUserInterfaceForPictureInPictureStop?: DirectEventHandler<{}>; onReceiveAdEvent?: DirectEventHandler; onVideoPlaybackStateChanged?: DirectEventHandler; // android only onVideoIdle?: DirectEventHandler<{}>; // android only (nowhere in document, so do not use as props. just type declaration) diff --git a/src/types/events.ts b/src/types/events.ts index bfde7a4b70..19933cbd6a 100644 --- a/src/types/events.ts +++ b/src/types/events.ts @@ -1,156 +1,24 @@ -import type Orientation from './Orientation'; -import type {AdEvent} from './Ads'; - -export type OnLoadData = Readonly<{ - currentTime: number; - duration: number; - naturalSize: Readonly<{ - width: number; - height: number; - orientation: Orientation; - }>; -}> & - OnAudioTracksData & - OnTextTracksData; - -export type OnVideoAspectRatioData = Readonly<{ - width: number; - height: number; -}>; - -export type OnLoadStartData = Readonly<{ - isNetwork: boolean; - type: string; - uri: string; -}>; - -export type OnProgressData = Readonly<{ - currentTime: number; - playableDuration: number; - seekableDuration: number; -}>; - -export type OnSeekData = Readonly<{ - currentTime: number; - seekTime: number; -}>; - -export type OnPlaybackStateChangedData = Readonly<{ - isPlaying: boolean; -}>; - -export type OnTimedMetadataData = Readonly<{ - metadata: ReadonlyArray< - Readonly<{ - value?: string; - identifier: string; - }> - >; -}>; - -export type AudioTrack = Readonly<{ - index: number; - title?: string; - language?: string; - bitrate?: number; - type?: string; - selected?: boolean; -}>; - -export type OnAudioTracksData = Readonly<{ - audioTracks: ReadonlyArray; -}>; - -export enum OnTextTracksTypeData { - SRT = 'srt', - TTML = 'ttml', - VTT = 'vtt', -} - -export type TextTrack = Readonly<{ - index: number; - title?: string; - language?: string; - type?: OnTextTracksTypeData; - selected?: boolean; -}>; - -export type OnTextTracksData = Readonly<{ - textTracks: ReadonlyArray; -}>; - -export type OnVideoTracksData = Readonly<{ - videoTracks: ReadonlyArray< - Readonly<{ - trackId: number; - codecs?: string; - width?: number; - height?: number; - bitrate?: number; - selected?: boolean; - }> - >; -}>; - -export type OnPlaybackData = Readonly<{ - playbackRate: number; -}>; - -export type OnVolumeChangeData = Readonly<{ - volume: number; -}>; - -export type OnExternalPlaybackChangeData = Readonly<{ - isExternalPlaybackActive: boolean; -}>; - -export type OnGetLicenseData = Readonly<{ - licenseUrl: string; - contentId: string; - spcBase64: string; -}>; - -export type OnPictureInPictureStatusChangedData = Readonly<{ - isActive: boolean; -}>; - -export type OnReceiveAdEventData = Readonly<{ - data?: Record; - event: AdEvent; -}>; - -export type OnVideoErrorData = Readonly<{ - error: OnVideoErrorDataDetails; - target?: number; // ios -}>; - -export type OnVideoErrorDataDetails = Readonly<{ - errorString?: string; // android - errorException?: string; // android - errorStackTrace?: string; // android - errorCode?: string; // android - error?: string; // ios - code?: number; // ios - localizedDescription?: string; // ios - localizedFailureReason?: string; // ios - localizedRecoverySuggestion?: string; // ios - domain?: string; // ios -}>; -export type OnAudioFocusChangedData = Readonly<{ - hasAudioFocus: boolean; -}>; - -export type OnBufferData = Readonly<{isBuffering: boolean}>; - -export type OnBandwidthUpdateData = Readonly< - | { - bitrate: number; - width: number; - height: number; - trackId: number; - } - | {bitrate: number} ->; +import type { + OnAudioFocusChangedData, + OnAudioTracksData, + OnBandwidthUpdateData, + OnBufferData, + OnExternalPlaybackChangeData, + OnLoadData, + OnLoadStartData, + OnPictureInPictureStatusChangedData, + OnPlaybackData, + OnPlaybackStateChangedData, + OnProgressData, + OnReceiveAdEventData, + OnSeekData, + OnTextTracksData, + OnTimedMetadataData, + OnVideoAspectRatioData, + OnVideoErrorData, + OnVideoTracksData, + OnVolumeChangeData, +} from '../specs/VideoNativeComponent'; export interface ReactVideoEvents { onAudioBecomingNoisy?: () => void; //Android, iOS diff --git a/src/types/video.ts b/src/types/video.ts index 48a8c35015..1d67eb91e4 100644 --- a/src/types/video.ts +++ b/src/types/video.ts @@ -3,6 +3,10 @@ import type {ReactVideoEvents} from './events'; import type {StyleProp, ViewProps, ViewStyle} from 'react-native'; import type VideoResizeMode from './ResizeMode'; import type FilterType from './FilterType'; +import type { + SelectedTrackType, + SelectedVideoTrackType, +} from '../specs/VideoNativeComponent'; export type Headers = Record; @@ -70,31 +74,6 @@ export type BufferConfig = { minBufferMemoryReservePercent?: number; }; -export enum SelectedTrackType { - SYSTEM = 'system', - DISABLED = 'disabled', - TITLE = 'title', - LANGUAGE = 'language', - INDEX = 'index', -} - -export type SelectedTrack = { - type: SelectedTrackType; - value?: string | number; -}; - -export enum SelectedVideoTrackType { - AUDO = 'auto', - DISABLED = 'disabled', - RESOLUTION = 'resolution', - IUNDEX = 'index', -} - -export type SelectedVideoTrack = { - type: SelectedVideoTrackType; - value?: number; -}; - export type SubtitleStyle = { fontSize?: number; paddingTop?: number; @@ -177,7 +156,7 @@ export enum PosterResizeModeType { export type AudioOutput = 'speaker' | 'earpiece'; export interface ReactVideoProps extends ReactVideoEvents, ViewProps { - source?: ReactVideoSource; + source: ReactVideoSource; drm?: Drm; style?: StyleProp; adTagUrl?: string; @@ -217,9 +196,9 @@ export interface ReactVideoProps extends ReactVideoEvents, ViewProps { repeat?: boolean; reportBandwidth?: boolean; //Android resizeMode?: EnumValues; - selectedAudioTrack?: SelectedTrack; - selectedTextTrack?: SelectedTrack; - selectedVideoTrack?: SelectedVideoTrack; // android + selectedAudioTrack?: SelectedTrackType; + selectedTextTrack?: SelectedTrackType; + selectedVideoTrack?: SelectedVideoTrackType; // android subtitleStyle?: SubtitleStyle; // android textTracks?: TextTracks; testID?: string; diff --git a/src/utils.ts b/src/utils.ts index 9af9c67b62..fe64820ee4 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -5,6 +5,14 @@ import type {ReactVideoSource, ReactVideoSourceProperties} from './types/video'; type Source = ImageSourcePropType | ReactVideoSource; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export function generateHeaderForNative(obj?: Record) { + if (!obj) { + return []; + } + return Object.entries(obj).map(([key, value]) => ({key, value})); +} + export function resolveAssetSourceForVideo( source: Source, ): ReactVideoSourceProperties { From ce872c718406a6706f1e685c48d9e3e6a55db5f3 Mon Sep 17 00:00:00 2001 From: yungblud Date: Fri, 19 Jan 2024 16:16:03 +0900 Subject: [PATCH 11/28] feat: modified codegenNativeComponent naming (RCTVideo) --- src/specs/VideoNativeComponent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/specs/VideoNativeComponent.ts b/src/specs/VideoNativeComponent.ts index 36441ce6bd..1606cb440d 100644 --- a/src/specs/VideoNativeComponent.ts +++ b/src/specs/VideoNativeComponent.ts @@ -559,5 +559,5 @@ export const VideoDecoderProperties = NativeModules.VideoDecoderProperties as VideoDecoderPropertiesType; export default codegenNativeComponent( - 'RNCVideo', + 'RCTVideo', ) as VideoComponentType; From 6a50754f7c5bde1ad61ed85e3fa331194a0b7eac Mon Sep 17 00:00:00 2001 From: yungblud Date: Fri, 19 Jan 2024 16:16:20 +0900 Subject: [PATCH 12/28] feat: pod installed example basic app --- examples/basic/ios/Podfile.lock | 12 ++++++------ .../ios/videoplayer.xcodeproj/project.pbxproj | 18 ++++++++---------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/examples/basic/ios/Podfile.lock b/examples/basic/ios/Podfile.lock index 7c88cc2f82..eb2298c057 100644 --- a/examples/basic/ios/Podfile.lock +++ b/examples/basic/ios/Podfile.lock @@ -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 diff --git a/examples/basic/ios/videoplayer.xcodeproj/project.pbxproj b/examples/basic/ios/videoplayer.xcodeproj/project.pbxproj index a59261a291..cd42b8c554 100644 --- a/examples/basic/ios/videoplayer.xcodeproj/project.pbxproj +++ b/examples/basic/ios/videoplayer.xcodeproj/project.pbxproj @@ -591,6 +591,9 @@ " ${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 +614,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 +677,9 @@ " ${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 +699,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; From 0c4bd9ce749d1e6c5f501e2ce4901836bc326314 Mon Sep 17 00:00:00 2001 From: yungblud Date: Sat, 20 Jan 2024 13:47:53 +0900 Subject: [PATCH 13/28] feat: bump up react-native dev dependency version to 0.73.2 for supporting codegen array event params --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a8711fccd7..7cc92e87a8 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "jest": "^29.7.0", "prettier": "^2.4.1", "react": "18.2.0", - "react-native": "0.72.5", + "react-native": "0.73.2", "react-native-windows": "^0.61.0-0", "release-it": "^16.2.1", "typescript": "5.1.6" From c9f6a9254592e66c3b9382aa2bebf35dc1ed7c10 Mon Sep 17 00:00:00 2001 From: yungblud Date: Sat, 20 Jan 2024 13:48:17 +0900 Subject: [PATCH 14/28] feat: support array param types on event callback function codegen types --- src/specs/VideoNativeComponent.ts | 87 +++++++++++-------------------- 1 file changed, 30 insertions(+), 57 deletions(-) diff --git a/src/specs/VideoNativeComponent.ts b/src/specs/VideoNativeComponent.ts index 1606cb440d..05cb0605a2 100644 --- a/src/specs/VideoNativeComponent.ts +++ b/src/specs/VideoNativeComponent.ts @@ -158,74 +158,47 @@ export type OnPlaybackStateChangedData = Readonly<{ }>; export type OnTimedMetadataData = Readonly<{ - metadata: Readonly<{}>; + metadata: { + value?: string; + identifier: string; + }[]; }>; -// TODO fix type after RN 0.73 -// export type OnTimedMetadataData = Readonly<{ -// metadata: ReadonlyArray< -// Readonly<{ -// value?: string; -// identifier: string; -// }> -// >; -// }>; export type OnAudioTracksData = Readonly<{ - audioTracks: Readonly<{}>; + audioTracks: { + index: Int32; + title?: string; + language?: string; + bitrate?: Float; + type?: string; + selected?: boolean; + }[]; }>; -// TODO fix type after RN 0.73 -// export type OnAudioTracksData = Readonly<{ -// audioTracks: ReadonlyArray< -// Readonly<{ -// index: Int32; -// title?: string; -// language?: string; -// bitrate?: Float; -// type?: string; -// selected?: boolean; -// }> -// >; -// }>; - export type OnTextTracksData = Readonly<{ - textTracks: Readonly<{}>; + textTracks: { + index: Int32; + title?: string; + language?: string; + /** + * iOS only supports VTT, Android supports all 3 + */ + type?: WithDefault<'srt' | 'ttml' | 'vtt', 'srt'>; + selected?: boolean; + }[]; }>; -// TODO fix type after RN 0.73 -// export type OnTextTracksData = Readonly<{ -// textTracks: ReadonlyArray< -// Readonly<{ -// index: Int32; -// title?: string; -// language?: string; -// /** -// * iOS only supports VTT, Android supports all 3 -// */ -// type?: WithDefault<'srt' | 'ttml' | 'vtt', 'srt'>; -// selected?: boolean; -// }> -// >; -// }>; - export type OnVideoTracksData = Readonly<{ - videoTracks: Readonly<{}>; + videoTracks: { + trackId: Int32; + codecs?: string; + width?: Float; + height?: Float; + bitrate?: Float; + selected?: boolean; + }[]; }>; -// TODO fix type after RN 0.73 -// export type OnVideoTracksData = Readonly<{ -// videoTracks: ReadonlyArray< -// Readonly<{ -// trackId: Int32; -// codecs?: string; -// width?: Float; -// height?: Float; -// bitrate?: Float; -// selected?: boolean; -// }> -// >; -// }>; - export type OnPlaybackData = Readonly<{ playbackRate: Float; }>; From 946d6a71d75369e2353d50d480efb25e6d798a9f Mon Sep 17 00:00:00 2001 From: yungblud Date: Sat, 20 Jan 2024 13:52:46 +0900 Subject: [PATCH 15/28] chore: pod installed ios basic example --- examples/basic/ios/videoplayer.xcodeproj/project.pbxproj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/basic/ios/videoplayer.xcodeproj/project.pbxproj b/examples/basic/ios/videoplayer.xcodeproj/project.pbxproj index cd42b8c554..91fb7fbffe 100644 --- a/examples/basic/ios/videoplayer.xcodeproj/project.pbxproj +++ b/examples/basic/ios/videoplayer.xcodeproj/project.pbxproj @@ -594,6 +594,9 @@ " ${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 = ( @@ -680,6 +683,9 @@ " ${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 = ( From 7944195e9dabcc6d4d9d6c7519903742ccb8df80 Mon Sep 17 00:00:00 2001 From: yungblud Date: Mon, 22 Jan 2024 12:27:13 +0900 Subject: [PATCH 16/28] feat: modified source prop as optional type --- src/Video.tsx | 5 ++++- src/types/video.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Video.tsx b/src/Video.tsx index 06da154026..868a656964 100644 --- a/src/Video.tsx +++ b/src/Video.tsx @@ -121,7 +121,10 @@ const Video = forwardRef( [posterResizeMode], ); - const src = useMemo(() => { + const src = useMemo(() => { + if (!source) { + return undefined; + } const resolvedSource = resolveAssetSourceForVideo(source); let uri = resolvedSource.uri || ''; if (uri && uri.match(/^\//)) { diff --git a/src/types/video.ts b/src/types/video.ts index 1d67eb91e4..711d7d6424 100644 --- a/src/types/video.ts +++ b/src/types/video.ts @@ -156,7 +156,7 @@ export enum PosterResizeModeType { export type AudioOutput = 'speaker' | 'earpiece'; export interface ReactVideoProps extends ReactVideoEvents, ViewProps { - source: ReactVideoSource; + source?: ReactVideoSource; drm?: Drm; style?: StyleProp; adTagUrl?: string; From d63ac94e5330f7c7fb50374f65f8f3f4e0a225d7 Mon Sep 17 00:00:00 2001 From: yungblud Date: Tue, 23 Jan 2024 13:05:01 +0900 Subject: [PATCH 17/28] feat: add original src/VideoComponent.ts again --- src/VideoComponent.ts | 409 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 409 insertions(+) create mode 100644 src/VideoComponent.ts diff --git a/src/VideoComponent.ts b/src/VideoComponent.ts new file mode 100644 index 0000000000..9692356129 --- /dev/null +++ b/src/VideoComponent.ts @@ -0,0 +1,409 @@ +import type { + HostComponent, + NativeSyntheticEvent, + ViewProps, +} from 'react-native'; +import {NativeModules, requireNativeComponent} from 'react-native'; +import type ResizeMode from './types/ResizeMode'; +import type FilterType from './types/FilterType'; +import type Orientation from './types/Orientation'; +import type {AdEvent, EnumValues, OnTextTracksTypeData} from './types'; + +// -------- There are types for native component (future codegen) -------- +// if you are looking for types for react component, see src/types/video.ts + +type Headers = Record; + +type VideoSrc = Readonly<{ + uri?: string; + isNetwork?: boolean; + isAsset?: boolean; + shouldCache?: boolean; + type?: string; + mainVer?: number; + patchVer?: number; + requestHeaders?: Headers; + startPosition?: number; + cropStart?: number; + cropEnd?: number; + title?: string; + subtitle?: string; + description?: string; + customImageUri?: string; +}>; + +export type Filter = + | 'None' + | 'CIColorInvert' + | 'CIColorMonochrome' + | 'CIColorPosterize' + | 'CIFalseColor' + | 'CIMaximumComponent' + | 'CIMinimumComponent' + | 'CIPhotoEffectChrome' + | 'CIPhotoEffectFade' + | 'CIPhotoEffectInstant' + | 'CIPhotoEffectMono' + | 'CIPhotoEffectNoir' + | 'CIPhotoEffectProcess' + | 'CIPhotoEffectTonal' + | 'CIPhotoEffectTransfer' + | 'CISepiaTone'; + +export type DRMType = 'widevine' | 'playready' | 'clearkey' | 'fairplay'; + +type DebugConfig = Readonly<{ + enable?: boolean; + thread?: boolean; +}>; + +type Drm = Readonly<{ + type?: DRMType; + licenseServer?: string; + headers?: Headers; + contentId?: string; // ios + certificateUrl?: string; // ios + base64Certificate?: boolean; // ios default: false + useExternalGetLicense?: boolean; // ios +}>; + +type TextTracks = ReadonlyArray< + Readonly<{ + title: string; + language: string; + type: string; + uri: string; + }> +>; + +type TextTrackType = 'system' | 'disabled' | 'title' | 'language' | 'index'; + +type SelectedTextTrack = Readonly<{ + type: TextTrackType; + value?: string | number; +}>; + +type AudioTrackType = 'system' | 'disabled' | 'title' | 'language' | 'index'; + +type SelectedAudioTrack = Readonly<{ + type: AudioTrackType; + value?: string | number; +}>; + +export type Seek = Readonly<{ + time: number; + tolerance?: number; +}>; + +type BufferConfig = Readonly<{ + minBufferMs?: number; + maxBufferMs?: number; + bufferForPlaybackMs?: number; + bufferForPlaybackAfterRebufferMs?: number; + maxHeapAllocationPercent?: number; + minBackBufferMemoryReservePercent?: number; + minBufferMemoryReservePercent?: number; +}>; + +type SelectedVideoTrack = Readonly<{ + type: 'auto' | 'disabled' | 'resolution' | 'index'; + value?: number; +}>; + +type SubtitleStyle = Readonly<{ + fontSize?: number; + paddingTop?: number; + paddingBottom?: number; + paddingLeft?: number; + paddingRight?: number; +}>; + +export type OnLoadData = Readonly<{ + currentTime: number; + duration: number; + naturalSize: Readonly<{ + width: number; + height: number; + orientation: Orientation; + }>; +}> & + OnAudioTracksData & + OnTextTracksData; + +export type OnLoadStartData = Readonly<{ + isNetwork: boolean; + type: string; + uri: string; +}>; + +export type OnVideoAspectRatioData = Readonly<{ + width: number; + height: number; +}>; + +export type OnBufferData = Readonly<{isBuffering: boolean}>; + +export type OnProgressData = Readonly<{ + currentTime: number; + playableDuration: number; + seekableDuration: number; +}>; + +export type OnBandwidthUpdateData = Readonly<{ + bitrate: number; + width?: number; + height?: number; + trackId?: number; +}>; + +export type OnSeekData = Readonly<{ + currentTime: number; + seekTime: number; +}>; + +export type OnPlaybackStateChangedData = Readonly<{ + isPlaying: boolean; +}>; + +export type OnTimedMetadataData = Readonly<{ + metadata: ReadonlyArray< + Readonly<{ + value?: string; + identifier: string; + }> + >; +}>; + +export type OnAudioTracksData = Readonly<{ + audioTracks: ReadonlyArray< + Readonly<{ + index: number; + title?: string; + language?: string; + bitrate?: number; + type?: string; + selected?: boolean; + }> + >; +}>; + +export type OnTextTracksData = Readonly<{ + textTracks: ReadonlyArray< + Readonly<{ + index: number; + title?: string; + language?: string; + /** + * iOS only supports VTT, Android supports all 3 + */ + type?: OnTextTracksTypeData; + selected?: boolean; + }> + >; +}>; + +export type OnVideoTracksData = Readonly<{ + videoTracks: ReadonlyArray< + Readonly<{ + trackId: number; + codecs?: string; + width?: number; + height?: number; + bitrate?: number; + selected?: boolean; + }> + >; +}>; + +export type OnPlaybackData = Readonly<{ + playbackRate: number; +}>; + +export type onVolumeChangeData = Readonly<{ + volume: number; +}>; + +export type OnExternalPlaybackChangeData = Readonly<{ + isExternalPlaybackActive: boolean; +}>; + +export type OnGetLicenseData = Readonly<{ + licenseUrl: string; + contentId: string; + spcBase64: string; +}>; + +export type OnPictureInPictureStatusChangedData = Readonly<{ + isActive: boolean; +}>; + +export type OnReceiveAdEventData = Readonly<{ + data?: Record; + event: AdEvent; +}>; + +export type OnVideoErrorData = Readonly<{ + error: OnVideoErrorDataDetails; + target?: number; // ios +}>; + +export type OnVideoErrorDataDetails = Readonly<{ + errorString?: string; // android + errorException?: string; // android + errorStackTrace?: string; // android + errorCode?: string; // android + error?: string; // ios + code?: number; // ios + localizedDescription?: string; // ios + localizedFailureReason?: string; // ios + localizedRecoverySuggestion?: string; // ios + domain?: string; // ios +}>; + +export type OnAudioFocusChangedData = Readonly<{ + hasAudioFocus: boolean; +}>; + +export interface VideoNativeProps extends ViewProps { + src?: VideoSrc; + drm?: Drm; + adTagUrl?: string; + allowsExternalPlayback?: boolean; // ios, true + maxBitRate?: number; + resizeMode?: EnumValues; + repeat?: boolean; + automaticallyWaitsToMinimizeStalling?: boolean; + textTracks?: TextTracks; + selectedTextTrack?: SelectedTextTrack; + selectedAudioTrack?: SelectedAudioTrack; + paused?: boolean; + muted?: boolean; + controls?: boolean; + filter?: EnumValues; + filterEnabled?: boolean; + volume?: number; // default 1.0 + playInBackground?: boolean; + preventsDisplaySleepDuringVideoPlayback?: boolean; + preferredForwardBufferDuration?: number; //ios, 0 + playWhenInactive?: boolean; // ios, false + pictureInPicture?: boolean; // ios, false + ignoreSilentSwitch?: 'inherit' | 'ignore' | 'obey'; // ios, 'inherit' + mixWithOthers?: 'inherit' | 'mix' | 'duck'; // ios, 'inherit' + rate?: number; + fullscreen?: boolean; // ios, false + fullscreenAutorotate?: boolean; + fullscreenOrientation?: 'all' | 'landscape' | 'portrait'; + progressUpdateInterval?: number; + restoreUserInterfaceForPIPStopCompletionHandler?: boolean; + localSourceEncryptionKeyScheme?: string; + debug?: DebugConfig; + + backBufferDurationMs?: number; // Android + bufferConfig?: BufferConfig; // Android + contentStartTime?: number; // Android + currentPlaybackTime?: number; // Android + disableDisconnectError?: boolean; // Android + focusable?: boolean; // Android + hideShutterView?: boolean; // Android + minLoadRetryCount?: number; // Android + reportBandwidth?: boolean; //Android + selectedVideoTrack?: SelectedVideoTrack; // android + subtitleStyle?: SubtitleStyle; // android + trackId?: string; // Android + useTextureView?: boolean; // Android + useSecureView?: boolean; // Android + onVideoLoad?: (event: NativeSyntheticEvent) => void; + onVideoLoadStart?: (event: NativeSyntheticEvent) => void; + onVideoAspectRatio?: ( + event: NativeSyntheticEvent, + ) => void; + onVideoBuffer?: (event: NativeSyntheticEvent) => void; + onVideoError?: (event: NativeSyntheticEvent) => void; + onVideoProgress?: (event: NativeSyntheticEvent) => void; + onVideoBandwidthUpdate?: ( + event: NativeSyntheticEvent, + ) => void; + onVideoSeek?: (event: NativeSyntheticEvent) => void; + onVideoEnd?: (event: NativeSyntheticEvent>) => void; // all + onVideoAudioBecomingNoisy?: ( + event: NativeSyntheticEvent>, + ) => void; + onVideoFullscreenPlayerWillPresent?: ( + event: NativeSyntheticEvent>, + ) => void; // ios, android + onVideoFullscreenPlayerDidPresent?: ( + event: NativeSyntheticEvent>, + ) => void; // ios, android + onVideoFullscreenPlayerWillDismiss?: ( + event: NativeSyntheticEvent>, + ) => void; // ios, android + onVideoFullscreenPlayerDidDismiss?: ( + event: NativeSyntheticEvent>, + ) => void; // ios, android + onReadyForDisplay?: (event: NativeSyntheticEvent>) => void; + onPlaybackRateChange?: (event: NativeSyntheticEvent) => void; // all + onVolumeChange?: (event: NativeSyntheticEvent) => void; // android, ios + onVideoExternalPlaybackChange?: ( + event: NativeSyntheticEvent, + ) => void; + onGetLicense?: (event: NativeSyntheticEvent) => void; + onPictureInPictureStatusChanged?: ( + event: NativeSyntheticEvent, + ) => void; + onRestoreUserInterfaceForPictureInPictureStop?: ( + event: NativeSyntheticEvent>, + ) => void; + onReceiveAdEvent?: ( + event: NativeSyntheticEvent, + ) => void; + onVideoPlaybackStateChanged?: ( + event: NativeSyntheticEvent, + ) => void; // android only + onVideoIdle?: (event: NativeSyntheticEvent) => void; // android only (nowhere in document, so do not use as props. just type declaration) + onAudioFocusChanged?: ( + event: NativeSyntheticEvent, + ) => void; // android only (nowhere in document, so do not use as props. just type declaration) + onTimedMetadata?: (event: NativeSyntheticEvent) => void; // ios, android + onAudioTracks?: (event: NativeSyntheticEvent) => void; // android + onTextTracks?: (event: NativeSyntheticEvent) => void; // android + onVideoTracks?: (event: NativeSyntheticEvent) => void; // android +} + +export type VideoComponentType = HostComponent; + +export type VideoSaveData = { + uri: string; +}; + +export interface VideoManagerType { + save: (option: object, reactTag: number) => Promise; + setPlayerPauseState: (paused: boolean, reactTag: number) => Promise; + setLicenseResult: ( + result: string, + licenseUrl: string, + reactTag: number, + ) => Promise; + setLicenseResultError: ( + error: string, + licenseUrl: string, + reactTag: number, + ) => Promise; +} + +export interface VideoDecoderPropertiesType { + getWidevineLevel: () => Promise; + isCodecSupported: ( + mimeType: string, + width: number, + height: number, + ) => Promise<'unsupported' | 'hardware' | 'software'>; + isHEVCSupported: () => Promise<'unsupported' | 'hardware' | 'software'>; +} + +export const VideoManager = NativeModules.VideoManager as VideoManagerType; +export const VideoDecoderProperties = + NativeModules.VideoDecoderProperties as VideoDecoderPropertiesType; + +export default requireNativeComponent( + 'RCTVideo', +) as VideoComponentType; From 8346b32d1cc3f174a4ec000731e550eed496e122 Mon Sep 17 00:00:00 2001 From: yungblud Date: Tue, 23 Jan 2024 13:05:47 +0900 Subject: [PATCH 18/28] Revert "feat: add original src/VideoComponent.ts again" This reverts commit d63ac94e5330f7c7fb50374f65f8f3f4e0a225d7. --- src/VideoComponent.ts | 409 ------------------------------------------ 1 file changed, 409 deletions(-) delete mode 100644 src/VideoComponent.ts diff --git a/src/VideoComponent.ts b/src/VideoComponent.ts deleted file mode 100644 index 9692356129..0000000000 --- a/src/VideoComponent.ts +++ /dev/null @@ -1,409 +0,0 @@ -import type { - HostComponent, - NativeSyntheticEvent, - ViewProps, -} from 'react-native'; -import {NativeModules, requireNativeComponent} from 'react-native'; -import type ResizeMode from './types/ResizeMode'; -import type FilterType from './types/FilterType'; -import type Orientation from './types/Orientation'; -import type {AdEvent, EnumValues, OnTextTracksTypeData} from './types'; - -// -------- There are types for native component (future codegen) -------- -// if you are looking for types for react component, see src/types/video.ts - -type Headers = Record; - -type VideoSrc = Readonly<{ - uri?: string; - isNetwork?: boolean; - isAsset?: boolean; - shouldCache?: boolean; - type?: string; - mainVer?: number; - patchVer?: number; - requestHeaders?: Headers; - startPosition?: number; - cropStart?: number; - cropEnd?: number; - title?: string; - subtitle?: string; - description?: string; - customImageUri?: string; -}>; - -export type Filter = - | 'None' - | 'CIColorInvert' - | 'CIColorMonochrome' - | 'CIColorPosterize' - | 'CIFalseColor' - | 'CIMaximumComponent' - | 'CIMinimumComponent' - | 'CIPhotoEffectChrome' - | 'CIPhotoEffectFade' - | 'CIPhotoEffectInstant' - | 'CIPhotoEffectMono' - | 'CIPhotoEffectNoir' - | 'CIPhotoEffectProcess' - | 'CIPhotoEffectTonal' - | 'CIPhotoEffectTransfer' - | 'CISepiaTone'; - -export type DRMType = 'widevine' | 'playready' | 'clearkey' | 'fairplay'; - -type DebugConfig = Readonly<{ - enable?: boolean; - thread?: boolean; -}>; - -type Drm = Readonly<{ - type?: DRMType; - licenseServer?: string; - headers?: Headers; - contentId?: string; // ios - certificateUrl?: string; // ios - base64Certificate?: boolean; // ios default: false - useExternalGetLicense?: boolean; // ios -}>; - -type TextTracks = ReadonlyArray< - Readonly<{ - title: string; - language: string; - type: string; - uri: string; - }> ->; - -type TextTrackType = 'system' | 'disabled' | 'title' | 'language' | 'index'; - -type SelectedTextTrack = Readonly<{ - type: TextTrackType; - value?: string | number; -}>; - -type AudioTrackType = 'system' | 'disabled' | 'title' | 'language' | 'index'; - -type SelectedAudioTrack = Readonly<{ - type: AudioTrackType; - value?: string | number; -}>; - -export type Seek = Readonly<{ - time: number; - tolerance?: number; -}>; - -type BufferConfig = Readonly<{ - minBufferMs?: number; - maxBufferMs?: number; - bufferForPlaybackMs?: number; - bufferForPlaybackAfterRebufferMs?: number; - maxHeapAllocationPercent?: number; - minBackBufferMemoryReservePercent?: number; - minBufferMemoryReservePercent?: number; -}>; - -type SelectedVideoTrack = Readonly<{ - type: 'auto' | 'disabled' | 'resolution' | 'index'; - value?: number; -}>; - -type SubtitleStyle = Readonly<{ - fontSize?: number; - paddingTop?: number; - paddingBottom?: number; - paddingLeft?: number; - paddingRight?: number; -}>; - -export type OnLoadData = Readonly<{ - currentTime: number; - duration: number; - naturalSize: Readonly<{ - width: number; - height: number; - orientation: Orientation; - }>; -}> & - OnAudioTracksData & - OnTextTracksData; - -export type OnLoadStartData = Readonly<{ - isNetwork: boolean; - type: string; - uri: string; -}>; - -export type OnVideoAspectRatioData = Readonly<{ - width: number; - height: number; -}>; - -export type OnBufferData = Readonly<{isBuffering: boolean}>; - -export type OnProgressData = Readonly<{ - currentTime: number; - playableDuration: number; - seekableDuration: number; -}>; - -export type OnBandwidthUpdateData = Readonly<{ - bitrate: number; - width?: number; - height?: number; - trackId?: number; -}>; - -export type OnSeekData = Readonly<{ - currentTime: number; - seekTime: number; -}>; - -export type OnPlaybackStateChangedData = Readonly<{ - isPlaying: boolean; -}>; - -export type OnTimedMetadataData = Readonly<{ - metadata: ReadonlyArray< - Readonly<{ - value?: string; - identifier: string; - }> - >; -}>; - -export type OnAudioTracksData = Readonly<{ - audioTracks: ReadonlyArray< - Readonly<{ - index: number; - title?: string; - language?: string; - bitrate?: number; - type?: string; - selected?: boolean; - }> - >; -}>; - -export type OnTextTracksData = Readonly<{ - textTracks: ReadonlyArray< - Readonly<{ - index: number; - title?: string; - language?: string; - /** - * iOS only supports VTT, Android supports all 3 - */ - type?: OnTextTracksTypeData; - selected?: boolean; - }> - >; -}>; - -export type OnVideoTracksData = Readonly<{ - videoTracks: ReadonlyArray< - Readonly<{ - trackId: number; - codecs?: string; - width?: number; - height?: number; - bitrate?: number; - selected?: boolean; - }> - >; -}>; - -export type OnPlaybackData = Readonly<{ - playbackRate: number; -}>; - -export type onVolumeChangeData = Readonly<{ - volume: number; -}>; - -export type OnExternalPlaybackChangeData = Readonly<{ - isExternalPlaybackActive: boolean; -}>; - -export type OnGetLicenseData = Readonly<{ - licenseUrl: string; - contentId: string; - spcBase64: string; -}>; - -export type OnPictureInPictureStatusChangedData = Readonly<{ - isActive: boolean; -}>; - -export type OnReceiveAdEventData = Readonly<{ - data?: Record; - event: AdEvent; -}>; - -export type OnVideoErrorData = Readonly<{ - error: OnVideoErrorDataDetails; - target?: number; // ios -}>; - -export type OnVideoErrorDataDetails = Readonly<{ - errorString?: string; // android - errorException?: string; // android - errorStackTrace?: string; // android - errorCode?: string; // android - error?: string; // ios - code?: number; // ios - localizedDescription?: string; // ios - localizedFailureReason?: string; // ios - localizedRecoverySuggestion?: string; // ios - domain?: string; // ios -}>; - -export type OnAudioFocusChangedData = Readonly<{ - hasAudioFocus: boolean; -}>; - -export interface VideoNativeProps extends ViewProps { - src?: VideoSrc; - drm?: Drm; - adTagUrl?: string; - allowsExternalPlayback?: boolean; // ios, true - maxBitRate?: number; - resizeMode?: EnumValues; - repeat?: boolean; - automaticallyWaitsToMinimizeStalling?: boolean; - textTracks?: TextTracks; - selectedTextTrack?: SelectedTextTrack; - selectedAudioTrack?: SelectedAudioTrack; - paused?: boolean; - muted?: boolean; - controls?: boolean; - filter?: EnumValues; - filterEnabled?: boolean; - volume?: number; // default 1.0 - playInBackground?: boolean; - preventsDisplaySleepDuringVideoPlayback?: boolean; - preferredForwardBufferDuration?: number; //ios, 0 - playWhenInactive?: boolean; // ios, false - pictureInPicture?: boolean; // ios, false - ignoreSilentSwitch?: 'inherit' | 'ignore' | 'obey'; // ios, 'inherit' - mixWithOthers?: 'inherit' | 'mix' | 'duck'; // ios, 'inherit' - rate?: number; - fullscreen?: boolean; // ios, false - fullscreenAutorotate?: boolean; - fullscreenOrientation?: 'all' | 'landscape' | 'portrait'; - progressUpdateInterval?: number; - restoreUserInterfaceForPIPStopCompletionHandler?: boolean; - localSourceEncryptionKeyScheme?: string; - debug?: DebugConfig; - - backBufferDurationMs?: number; // Android - bufferConfig?: BufferConfig; // Android - contentStartTime?: number; // Android - currentPlaybackTime?: number; // Android - disableDisconnectError?: boolean; // Android - focusable?: boolean; // Android - hideShutterView?: boolean; // Android - minLoadRetryCount?: number; // Android - reportBandwidth?: boolean; //Android - selectedVideoTrack?: SelectedVideoTrack; // android - subtitleStyle?: SubtitleStyle; // android - trackId?: string; // Android - useTextureView?: boolean; // Android - useSecureView?: boolean; // Android - onVideoLoad?: (event: NativeSyntheticEvent) => void; - onVideoLoadStart?: (event: NativeSyntheticEvent) => void; - onVideoAspectRatio?: ( - event: NativeSyntheticEvent, - ) => void; - onVideoBuffer?: (event: NativeSyntheticEvent) => void; - onVideoError?: (event: NativeSyntheticEvent) => void; - onVideoProgress?: (event: NativeSyntheticEvent) => void; - onVideoBandwidthUpdate?: ( - event: NativeSyntheticEvent, - ) => void; - onVideoSeek?: (event: NativeSyntheticEvent) => void; - onVideoEnd?: (event: NativeSyntheticEvent>) => void; // all - onVideoAudioBecomingNoisy?: ( - event: NativeSyntheticEvent>, - ) => void; - onVideoFullscreenPlayerWillPresent?: ( - event: NativeSyntheticEvent>, - ) => void; // ios, android - onVideoFullscreenPlayerDidPresent?: ( - event: NativeSyntheticEvent>, - ) => void; // ios, android - onVideoFullscreenPlayerWillDismiss?: ( - event: NativeSyntheticEvent>, - ) => void; // ios, android - onVideoFullscreenPlayerDidDismiss?: ( - event: NativeSyntheticEvent>, - ) => void; // ios, android - onReadyForDisplay?: (event: NativeSyntheticEvent>) => void; - onPlaybackRateChange?: (event: NativeSyntheticEvent) => void; // all - onVolumeChange?: (event: NativeSyntheticEvent) => void; // android, ios - onVideoExternalPlaybackChange?: ( - event: NativeSyntheticEvent, - ) => void; - onGetLicense?: (event: NativeSyntheticEvent) => void; - onPictureInPictureStatusChanged?: ( - event: NativeSyntheticEvent, - ) => void; - onRestoreUserInterfaceForPictureInPictureStop?: ( - event: NativeSyntheticEvent>, - ) => void; - onReceiveAdEvent?: ( - event: NativeSyntheticEvent, - ) => void; - onVideoPlaybackStateChanged?: ( - event: NativeSyntheticEvent, - ) => void; // android only - onVideoIdle?: (event: NativeSyntheticEvent) => void; // android only (nowhere in document, so do not use as props. just type declaration) - onAudioFocusChanged?: ( - event: NativeSyntheticEvent, - ) => void; // android only (nowhere in document, so do not use as props. just type declaration) - onTimedMetadata?: (event: NativeSyntheticEvent) => void; // ios, android - onAudioTracks?: (event: NativeSyntheticEvent) => void; // android - onTextTracks?: (event: NativeSyntheticEvent) => void; // android - onVideoTracks?: (event: NativeSyntheticEvent) => void; // android -} - -export type VideoComponentType = HostComponent; - -export type VideoSaveData = { - uri: string; -}; - -export interface VideoManagerType { - save: (option: object, reactTag: number) => Promise; - setPlayerPauseState: (paused: boolean, reactTag: number) => Promise; - setLicenseResult: ( - result: string, - licenseUrl: string, - reactTag: number, - ) => Promise; - setLicenseResultError: ( - error: string, - licenseUrl: string, - reactTag: number, - ) => Promise; -} - -export interface VideoDecoderPropertiesType { - getWidevineLevel: () => Promise; - isCodecSupported: ( - mimeType: string, - width: number, - height: number, - ) => Promise<'unsupported' | 'hardware' | 'software'>; - isHEVCSupported: () => Promise<'unsupported' | 'hardware' | 'software'>; -} - -export const VideoManager = NativeModules.VideoManager as VideoManagerType; -export const VideoDecoderProperties = - NativeModules.VideoDecoderProperties as VideoDecoderPropertiesType; - -export default requireNativeComponent( - 'RCTVideo', -) as VideoComponentType; From f5033068b738812c6911faef6482e81c0fe9691a Mon Sep 17 00:00:00 2001 From: yungblud Date: Tue, 23 Jan 2024 13:07:06 +0900 Subject: [PATCH 19/28] feat: add original src/VideoComponent.ts again with original file name --- src/VideoNativeComponent.ts | 409 ++++++++++++++++++++++++++++++++++++ 1 file changed, 409 insertions(+) create mode 100644 src/VideoNativeComponent.ts diff --git a/src/VideoNativeComponent.ts b/src/VideoNativeComponent.ts new file mode 100644 index 0000000000..9692356129 --- /dev/null +++ b/src/VideoNativeComponent.ts @@ -0,0 +1,409 @@ +import type { + HostComponent, + NativeSyntheticEvent, + ViewProps, +} from 'react-native'; +import {NativeModules, requireNativeComponent} from 'react-native'; +import type ResizeMode from './types/ResizeMode'; +import type FilterType from './types/FilterType'; +import type Orientation from './types/Orientation'; +import type {AdEvent, EnumValues, OnTextTracksTypeData} from './types'; + +// -------- There are types for native component (future codegen) -------- +// if you are looking for types for react component, see src/types/video.ts + +type Headers = Record; + +type VideoSrc = Readonly<{ + uri?: string; + isNetwork?: boolean; + isAsset?: boolean; + shouldCache?: boolean; + type?: string; + mainVer?: number; + patchVer?: number; + requestHeaders?: Headers; + startPosition?: number; + cropStart?: number; + cropEnd?: number; + title?: string; + subtitle?: string; + description?: string; + customImageUri?: string; +}>; + +export type Filter = + | 'None' + | 'CIColorInvert' + | 'CIColorMonochrome' + | 'CIColorPosterize' + | 'CIFalseColor' + | 'CIMaximumComponent' + | 'CIMinimumComponent' + | 'CIPhotoEffectChrome' + | 'CIPhotoEffectFade' + | 'CIPhotoEffectInstant' + | 'CIPhotoEffectMono' + | 'CIPhotoEffectNoir' + | 'CIPhotoEffectProcess' + | 'CIPhotoEffectTonal' + | 'CIPhotoEffectTransfer' + | 'CISepiaTone'; + +export type DRMType = 'widevine' | 'playready' | 'clearkey' | 'fairplay'; + +type DebugConfig = Readonly<{ + enable?: boolean; + thread?: boolean; +}>; + +type Drm = Readonly<{ + type?: DRMType; + licenseServer?: string; + headers?: Headers; + contentId?: string; // ios + certificateUrl?: string; // ios + base64Certificate?: boolean; // ios default: false + useExternalGetLicense?: boolean; // ios +}>; + +type TextTracks = ReadonlyArray< + Readonly<{ + title: string; + language: string; + type: string; + uri: string; + }> +>; + +type TextTrackType = 'system' | 'disabled' | 'title' | 'language' | 'index'; + +type SelectedTextTrack = Readonly<{ + type: TextTrackType; + value?: string | number; +}>; + +type AudioTrackType = 'system' | 'disabled' | 'title' | 'language' | 'index'; + +type SelectedAudioTrack = Readonly<{ + type: AudioTrackType; + value?: string | number; +}>; + +export type Seek = Readonly<{ + time: number; + tolerance?: number; +}>; + +type BufferConfig = Readonly<{ + minBufferMs?: number; + maxBufferMs?: number; + bufferForPlaybackMs?: number; + bufferForPlaybackAfterRebufferMs?: number; + maxHeapAllocationPercent?: number; + minBackBufferMemoryReservePercent?: number; + minBufferMemoryReservePercent?: number; +}>; + +type SelectedVideoTrack = Readonly<{ + type: 'auto' | 'disabled' | 'resolution' | 'index'; + value?: number; +}>; + +type SubtitleStyle = Readonly<{ + fontSize?: number; + paddingTop?: number; + paddingBottom?: number; + paddingLeft?: number; + paddingRight?: number; +}>; + +export type OnLoadData = Readonly<{ + currentTime: number; + duration: number; + naturalSize: Readonly<{ + width: number; + height: number; + orientation: Orientation; + }>; +}> & + OnAudioTracksData & + OnTextTracksData; + +export type OnLoadStartData = Readonly<{ + isNetwork: boolean; + type: string; + uri: string; +}>; + +export type OnVideoAspectRatioData = Readonly<{ + width: number; + height: number; +}>; + +export type OnBufferData = Readonly<{isBuffering: boolean}>; + +export type OnProgressData = Readonly<{ + currentTime: number; + playableDuration: number; + seekableDuration: number; +}>; + +export type OnBandwidthUpdateData = Readonly<{ + bitrate: number; + width?: number; + height?: number; + trackId?: number; +}>; + +export type OnSeekData = Readonly<{ + currentTime: number; + seekTime: number; +}>; + +export type OnPlaybackStateChangedData = Readonly<{ + isPlaying: boolean; +}>; + +export type OnTimedMetadataData = Readonly<{ + metadata: ReadonlyArray< + Readonly<{ + value?: string; + identifier: string; + }> + >; +}>; + +export type OnAudioTracksData = Readonly<{ + audioTracks: ReadonlyArray< + Readonly<{ + index: number; + title?: string; + language?: string; + bitrate?: number; + type?: string; + selected?: boolean; + }> + >; +}>; + +export type OnTextTracksData = Readonly<{ + textTracks: ReadonlyArray< + Readonly<{ + index: number; + title?: string; + language?: string; + /** + * iOS only supports VTT, Android supports all 3 + */ + type?: OnTextTracksTypeData; + selected?: boolean; + }> + >; +}>; + +export type OnVideoTracksData = Readonly<{ + videoTracks: ReadonlyArray< + Readonly<{ + trackId: number; + codecs?: string; + width?: number; + height?: number; + bitrate?: number; + selected?: boolean; + }> + >; +}>; + +export type OnPlaybackData = Readonly<{ + playbackRate: number; +}>; + +export type onVolumeChangeData = Readonly<{ + volume: number; +}>; + +export type OnExternalPlaybackChangeData = Readonly<{ + isExternalPlaybackActive: boolean; +}>; + +export type OnGetLicenseData = Readonly<{ + licenseUrl: string; + contentId: string; + spcBase64: string; +}>; + +export type OnPictureInPictureStatusChangedData = Readonly<{ + isActive: boolean; +}>; + +export type OnReceiveAdEventData = Readonly<{ + data?: Record; + event: AdEvent; +}>; + +export type OnVideoErrorData = Readonly<{ + error: OnVideoErrorDataDetails; + target?: number; // ios +}>; + +export type OnVideoErrorDataDetails = Readonly<{ + errorString?: string; // android + errorException?: string; // android + errorStackTrace?: string; // android + errorCode?: string; // android + error?: string; // ios + code?: number; // ios + localizedDescription?: string; // ios + localizedFailureReason?: string; // ios + localizedRecoverySuggestion?: string; // ios + domain?: string; // ios +}>; + +export type OnAudioFocusChangedData = Readonly<{ + hasAudioFocus: boolean; +}>; + +export interface VideoNativeProps extends ViewProps { + src?: VideoSrc; + drm?: Drm; + adTagUrl?: string; + allowsExternalPlayback?: boolean; // ios, true + maxBitRate?: number; + resizeMode?: EnumValues; + repeat?: boolean; + automaticallyWaitsToMinimizeStalling?: boolean; + textTracks?: TextTracks; + selectedTextTrack?: SelectedTextTrack; + selectedAudioTrack?: SelectedAudioTrack; + paused?: boolean; + muted?: boolean; + controls?: boolean; + filter?: EnumValues; + filterEnabled?: boolean; + volume?: number; // default 1.0 + playInBackground?: boolean; + preventsDisplaySleepDuringVideoPlayback?: boolean; + preferredForwardBufferDuration?: number; //ios, 0 + playWhenInactive?: boolean; // ios, false + pictureInPicture?: boolean; // ios, false + ignoreSilentSwitch?: 'inherit' | 'ignore' | 'obey'; // ios, 'inherit' + mixWithOthers?: 'inherit' | 'mix' | 'duck'; // ios, 'inherit' + rate?: number; + fullscreen?: boolean; // ios, false + fullscreenAutorotate?: boolean; + fullscreenOrientation?: 'all' | 'landscape' | 'portrait'; + progressUpdateInterval?: number; + restoreUserInterfaceForPIPStopCompletionHandler?: boolean; + localSourceEncryptionKeyScheme?: string; + debug?: DebugConfig; + + backBufferDurationMs?: number; // Android + bufferConfig?: BufferConfig; // Android + contentStartTime?: number; // Android + currentPlaybackTime?: number; // Android + disableDisconnectError?: boolean; // Android + focusable?: boolean; // Android + hideShutterView?: boolean; // Android + minLoadRetryCount?: number; // Android + reportBandwidth?: boolean; //Android + selectedVideoTrack?: SelectedVideoTrack; // android + subtitleStyle?: SubtitleStyle; // android + trackId?: string; // Android + useTextureView?: boolean; // Android + useSecureView?: boolean; // Android + onVideoLoad?: (event: NativeSyntheticEvent) => void; + onVideoLoadStart?: (event: NativeSyntheticEvent) => void; + onVideoAspectRatio?: ( + event: NativeSyntheticEvent, + ) => void; + onVideoBuffer?: (event: NativeSyntheticEvent) => void; + onVideoError?: (event: NativeSyntheticEvent) => void; + onVideoProgress?: (event: NativeSyntheticEvent) => void; + onVideoBandwidthUpdate?: ( + event: NativeSyntheticEvent, + ) => void; + onVideoSeek?: (event: NativeSyntheticEvent) => void; + onVideoEnd?: (event: NativeSyntheticEvent>) => void; // all + onVideoAudioBecomingNoisy?: ( + event: NativeSyntheticEvent>, + ) => void; + onVideoFullscreenPlayerWillPresent?: ( + event: NativeSyntheticEvent>, + ) => void; // ios, android + onVideoFullscreenPlayerDidPresent?: ( + event: NativeSyntheticEvent>, + ) => void; // ios, android + onVideoFullscreenPlayerWillDismiss?: ( + event: NativeSyntheticEvent>, + ) => void; // ios, android + onVideoFullscreenPlayerDidDismiss?: ( + event: NativeSyntheticEvent>, + ) => void; // ios, android + onReadyForDisplay?: (event: NativeSyntheticEvent>) => void; + onPlaybackRateChange?: (event: NativeSyntheticEvent) => void; // all + onVolumeChange?: (event: NativeSyntheticEvent) => void; // android, ios + onVideoExternalPlaybackChange?: ( + event: NativeSyntheticEvent, + ) => void; + onGetLicense?: (event: NativeSyntheticEvent) => void; + onPictureInPictureStatusChanged?: ( + event: NativeSyntheticEvent, + ) => void; + onRestoreUserInterfaceForPictureInPictureStop?: ( + event: NativeSyntheticEvent>, + ) => void; + onReceiveAdEvent?: ( + event: NativeSyntheticEvent, + ) => void; + onVideoPlaybackStateChanged?: ( + event: NativeSyntheticEvent, + ) => void; // android only + onVideoIdle?: (event: NativeSyntheticEvent) => void; // android only (nowhere in document, so do not use as props. just type declaration) + onAudioFocusChanged?: ( + event: NativeSyntheticEvent, + ) => void; // android only (nowhere in document, so do not use as props. just type declaration) + onTimedMetadata?: (event: NativeSyntheticEvent) => void; // ios, android + onAudioTracks?: (event: NativeSyntheticEvent) => void; // android + onTextTracks?: (event: NativeSyntheticEvent) => void; // android + onVideoTracks?: (event: NativeSyntheticEvent) => void; // android +} + +export type VideoComponentType = HostComponent; + +export type VideoSaveData = { + uri: string; +}; + +export interface VideoManagerType { + save: (option: object, reactTag: number) => Promise; + setPlayerPauseState: (paused: boolean, reactTag: number) => Promise; + setLicenseResult: ( + result: string, + licenseUrl: string, + reactTag: number, + ) => Promise; + setLicenseResultError: ( + error: string, + licenseUrl: string, + reactTag: number, + ) => Promise; +} + +export interface VideoDecoderPropertiesType { + getWidevineLevel: () => Promise; + isCodecSupported: ( + mimeType: string, + width: number, + height: number, + ) => Promise<'unsupported' | 'hardware' | 'software'>; + isHEVCSupported: () => Promise<'unsupported' | 'hardware' | 'software'>; +} + +export const VideoManager = NativeModules.VideoManager as VideoManagerType; +export const VideoDecoderProperties = + NativeModules.VideoDecoderProperties as VideoDecoderPropertiesType; + +export default requireNativeComponent( + 'RCTVideo', +) as VideoComponentType; From 7ce67857855ecc41f0a84607c936981cb48a9067 Mon Sep 17 00:00:00 2001 From: yungblud Date: Tue, 23 Jan 2024 13:15:34 +0900 Subject: [PATCH 20/28] feat: git rm src/specs/VideoNativeComponent.ts --- src/specs/VideoNativeComponent.ts | 536 ------------------------------ 1 file changed, 536 deletions(-) delete mode 100644 src/specs/VideoNativeComponent.ts diff --git a/src/specs/VideoNativeComponent.ts b/src/specs/VideoNativeComponent.ts deleted file mode 100644 index 05cb0605a2..0000000000 --- a/src/specs/VideoNativeComponent.ts +++ /dev/null @@ -1,536 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-types */ -import type {HostComponent, ViewProps} from 'react-native'; -import {NativeModules} from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -import type { - DirectEventHandler, - Double, - Float, - Int32, - WithDefault, -} from 'react-native/Libraries/Types/CodegenTypes'; - -// -------- There are types for native component (future codegen) -------- -// if you are looking for types for react component, see src/types/video.ts - -type Headers = ReadonlyArray< - Readonly<{ - key: string; - value: string; - }> ->; - -export type VideoSrc = Readonly<{ - uri?: string; - isNetwork?: boolean; - isAsset?: boolean; - shouldCache?: boolean; - type?: string; - mainVer?: Int32; - patchVer?: Int32; - requestHeaders?: Headers; - startPosition?: Float; - cropStart?: Float; - cropEnd?: Float; - title?: string; - subtitle?: string; - description?: string; - customImageUri?: string; -}>; - -export type DRMType = WithDefault< - 'widevine' | 'playready' | 'clearkey' | 'fairplay', - 'widevine' ->; - -type DebugConfig = Readonly<{ - enable?: boolean; - thread?: boolean; -}>; - -type Drm = Readonly<{ - type?: DRMType; - licenseServer?: string; - headers?: Headers; - contentId?: string; // ios - certificateUrl?: string; // ios - base64Certificate?: boolean; // ios default: false - useExternalGetLicense?: boolean; // ios -}>; - -type TextTracks = ReadonlyArray< - Readonly<{ - title: string; - language: string; - type: string; - uri: string; - }> ->; - -type SelectedTrack = WithDefault< - 'system' | 'disabled' | 'title' | 'language' | 'index', - 'system' ->; - -export type SelectedTrackType = Readonly<{ - type?: SelectedTrack; - value?: string; -}>; - -export type Seek = Readonly<{ - time: Float; - tolerance?: Float; -}>; - -type BufferConfig = Readonly<{ - minBufferMs?: Float; - maxBufferMs?: Float; - bufferForPlaybackMs?: Float; - bufferForPlaybackAfterRebufferMs?: Float; - maxHeapAllocationPercent?: Float; - minBackBufferMemoryReservePercent?: Float; - minBufferMemoryReservePercent?: Float; -}>; - -type SelectedVideoTrack = WithDefault< - 'auto' | 'disabled' | 'resolution' | 'index', - 'auto' ->; - -export type SelectedVideoTrackType = Readonly<{ - type?: SelectedVideoTrack; - value?: Int32; -}>; - -type SubtitleStyle = Readonly<{ - fontSize?: Float; - paddingTop?: WithDefault; - paddingBottom?: WithDefault; - paddingLeft?: WithDefault; - paddingRight?: WithDefault; -}>; - -export type OnLoadData = Readonly<{ - currentTime: Float; - duration: Float; - naturalSize: Readonly<{ - width: Float; - height: Float; - orientation: WithDefault<'landscape' | 'portrait', 'landscape'>; - }>; - audioTracks: Readonly<{}>; - textTracks: Readonly<{}>; -}>; - -export type OnLoadStartData = Readonly<{ - isNetwork: boolean; - type: string; - uri: string; -}>; - -export type OnVideoAspectRatioData = Readonly<{ - width: Float; - height: Float; -}>; - -export type OnBufferData = Readonly<{isBuffering: boolean}>; - -export type OnProgressData = Readonly<{ - currentTime: Float; - playableDuration: Float; - seekableDuration: Float; -}>; - -export type OnBandwidthUpdateData = Readonly<{ - bitrate: Int32; - width?: Float; - height?: Float; - trackId?: Int32; -}>; - -export type OnSeekData = Readonly<{ - currentTime: Float; - seekTime: Float; -}>; - -export type OnPlaybackStateChangedData = Readonly<{ - isPlaying: boolean; -}>; - -export type OnTimedMetadataData = Readonly<{ - metadata: { - value?: string; - identifier: string; - }[]; -}>; - -export type OnAudioTracksData = Readonly<{ - audioTracks: { - index: Int32; - title?: string; - language?: string; - bitrate?: Float; - type?: string; - selected?: boolean; - }[]; -}>; - -export type OnTextTracksData = Readonly<{ - textTracks: { - index: Int32; - title?: string; - language?: string; - /** - * iOS only supports VTT, Android supports all 3 - */ - type?: WithDefault<'srt' | 'ttml' | 'vtt', 'srt'>; - selected?: boolean; - }[]; -}>; - -export type OnVideoTracksData = Readonly<{ - videoTracks: { - trackId: Int32; - codecs?: string; - width?: Float; - height?: Float; - bitrate?: Float; - selected?: boolean; - }[]; -}>; - -export type OnPlaybackData = Readonly<{ - playbackRate: Float; -}>; - -export type OnVolumeChangeData = Readonly<{ - volume: Float; -}>; - -export type OnExternalPlaybackChangeData = Readonly<{ - isExternalPlaybackActive: boolean; -}>; - -export type OnGetLicenseData = Readonly<{ - licenseUrl: string; - contentId: string; - spcBase64: string; -}>; - -export type OnPictureInPictureStatusChangedData = Readonly<{ - isActive: boolean; -}>; - -export type OnReceiveAdEventData = Readonly<{ - data?: {}; - event: WithDefault< - /** - * iOS only: Fired the first time each ad break ends. Applications must reenable seeking when this occurs (only used for dynamic ad insertion). - */ | 'AD_BREAK_ENDED' - /** - * Fires when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false. - */ - | 'AD_BREAK_READY' - /** - * iOS only: Fired first time each ad break begins playback. If an ad break is watched subsequent times this will not be fired. Applications must disable seeking when this occurs (only used for dynamic ad insertion). - */ - | 'AD_BREAK_STARTED' - /** - * Android only: Fires when the ad has stalled playback to buffer. - */ - | 'AD_BUFFERING' - /** - * Android only: Fires when the ad is ready to play without buffering, either at the beginning of the ad or after buffering completes. - */ - | 'AD_CAN_PLAY' - /** - * Android only: Fires when an ads list is loaded. - */ - | 'AD_METADATA' - /** - * iOS only: Fired every time the stream switches from advertising or slate to content. This will be fired even when an ad is played a second time or when seeking into an ad (only used for dynamic ad insertion). - */ - | 'AD_PERIOD_ENDED' - /** - * iOS only: Fired every time the stream switches from content to advertising or slate. This will be fired even when an ad is played a second time or when seeking into an ad (only used for dynamic ad insertion). - */ - | 'AD_PERIOD_STARTED' - /** - * Android only: Fires when the ad's current time value changes. The event `data` will be populated with an AdProgressData object. - */ - | 'AD_PROGRESS' - /** - * Fires when the ads manager is done playing all the valid ads in the ads response, or when the response doesn't return any valid ads. - */ - | 'ALL_ADS_COMPLETED' - /** - * Fires when the ad is clicked. - */ - | 'CLICK' - /** - * Fires when the ad completes playing. - */ - | 'COMPLETED' - /** - * Android only: Fires when content should be paused. This usually happens right before an ad is about to cover the content. - */ - | 'CONTENT_PAUSE_REQUESTED' - /** - * Android only: Fires when content should be resumed. This usually happens when an ad finishes or collapses. - */ - | 'CONTENT_RESUME_REQUESTED' - /** - * iOS only: Cuepoints changed for VOD stream (only used for dynamic ad insertion). - */ - | 'CUEPOINTS_CHANGED' - /** - * Android only: Fires when the ad's duration changes. - */ - | 'DURATION_CHANGE' - /** - * Fires when an error is encountered and the ad can't be played. - */ - | 'ERROR' - /** - * Fires when the ad playhead crosses first quartile. - */ - | 'FIRST_QUARTILE' - /** - * Android only: Fires when the impression URL has been pinged. - */ - | 'IMPRESSION' - /** - * Android only: Fires when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data. - */ - | 'INTERACTION' - /** - * Android only: Fires when the displayed ad changes from linear to nonlinear, or the reverse. - */ - | 'LINEAR_CHANGED' - /** - * Fires when ad data is available. - */ - | 'LOADED' - /** - * Fires when a non-fatal error is encountered. The user need not take any action since the SDK will continue with the same or next ad playback depending on the error situation. - */ - | 'LOG' - /** - * Fires when the ad playhead crosses midpoint. - */ - | 'MIDPOINT' - /** - * Fires when the ad is paused. - */ - | 'PAUSED' - /** - * Fires when the ad is resumed. - */ - | 'RESUMED' - /** - * Android only: Fires when the displayed ads skippable state is changed. - */ - | 'SKIPPABLE_STATE_CHANGED' - /** - * Fires when the ad is skipped by the user. - */ - | 'SKIPPED' - /** - * Fires when the ad starts playing. - */ - | 'STARTED' - /** - * iOS only: Stream request has loaded (only used for dynamic ad insertion). - */ - | 'STREAM_LOADED' - /** - * iOS only: Fires when the ad is tapped. - */ - | 'TAPPED' - /** - * Fires when the ad playhead crosses third quartile. - */ - | 'THIRD_QUARTILE' - /** - * iOS only: An unknown event has fired - */ - | 'UNKNOWN' - /** - * Android only: Fires when the ad is closed by the user. - */ - | 'USER_CLOSE' - /** - * Android only: Fires when the non-clickthrough portion of a video ad is clicked. - */ - | 'VIDEO_CLICKED' - /** - * Android only: Fires when a user clicks a video icon. - */ - | 'VIDEO_ICON_CLICKED' - /** - * Android only: Fires when the ad volume has changed. - */ - | 'VOLUME_CHANGED' - /** - * Android only: Fires when the ad volume has been muted. - */ - | 'VOLUME_MUTED', - 'AD_BREAK_ENDED' - >; -}>; - -export type OnVideoErrorData = Readonly<{ - error: Readonly<{ - errorString?: string; // android - errorException?: string; // android - errorStackTrace?: string; // android - errorCode?: string; // android - error?: string; // ios - code?: Int32; // ios - localizedDescription?: string; // ios - localizedFailureReason?: string; // ios - localizedRecoverySuggestion?: string; // ios - domain?: string; // ios - }>; - target?: Int32; // ios -}>; - -export type OnAudioFocusChangedData = Readonly<{ - hasAudioFocus: boolean; -}>; - -export interface VideoNativeProps extends ViewProps { - src?: VideoSrc; - drm?: Drm; - adTagUrl?: string; - allowsExternalPlayback?: boolean; // ios, true - maxBitRate?: Float; - resizeMode?: WithDefault<'none' | 'contain' | 'cover' | 'stretch', 'none'>; - repeat?: boolean; - automaticallyWaitsToMinimizeStalling?: boolean; - textTracks?: TextTracks; - selectedTextTrack?: SelectedTrackType; - selectedAudioTrack?: SelectedTrackType; - paused?: boolean; - muted?: boolean; - controls?: boolean; - filter?: WithDefault< - | '' - | 'CIColorInvert' - | 'CIColorMonochrome' - | 'CIColorPosterize' - | 'CIFalseColor' - | 'CIMaximumComponent' - | 'CIMinimumComponent' - | 'CIPhotoEffectChrome' - | 'CIPhotoEffectFade' - | 'CIPhotoEffectInstant' - | 'CIPhotoEffectMono' - | 'CIPhotoEffectNoir' - | 'CIPhotoEffectProcess' - | 'CIPhotoEffectTonal' - | 'CIPhotoEffectTransfer' - | 'CISepiaTone', - '' - >; - filterEnabled?: boolean; - volume?: Float; // default 1.0 - playInBackground?: boolean; - preventsDisplaySleepDuringVideoPlayback?: boolean; - preferredForwardBufferDuration?: Float; //ios, 0 - playWhenInactive?: boolean; // ios, false - pictureInPicture?: boolean; // ios, false - ignoreSilentSwitch?: WithDefault<'inherit' | 'ignore' | 'obey', 'inherit'>; // ios, 'inherit' - mixWithOthers?: WithDefault<'inherit' | 'mix' | 'duck', 'inherit'>; // ios, 'inherit' - rate?: Float; - fullscreen?: boolean; // ios, false - fullscreenAutorotate?: boolean; - fullscreenOrientation?: WithDefault<'all' | 'landscape' | 'portrait', 'all'>; - progressUpdateInterval?: Float; - restoreUserInterfaceForPIPStopCompletionHandler?: boolean; - localSourceEncryptionKeyScheme?: string; - debug?: DebugConfig; - - backBufferDurationMs?: Int32; // Android - bufferConfig?: BufferConfig; // Android - contentStartTime?: Int32; // Android - currentPlaybackTime?: Double; // Android - disableDisconnectError?: boolean; // Android - focusable?: boolean; // Android - hideShutterView?: boolean; // Android - minLoadRetryCount?: Int32; // Android - reportBandwidth?: boolean; //Android - selectedVideoTrack?: SelectedVideoTrackType; // android - subtitleStyle?: SubtitleStyle; // android - trackId?: string; // Android - useTextureView?: boolean; // Android - useSecureView?: boolean; // Android - onVideoLoad?: DirectEventHandler; - onVideoLoadStart?: DirectEventHandler; - onVideoAspectRatio?: DirectEventHandler; - onVideoBuffer?: DirectEventHandler; - onVideoError?: DirectEventHandler; - onVideoProgress?: DirectEventHandler; - onVideoBandwidthUpdate?: DirectEventHandler; - onVideoSeek?: DirectEventHandler; - onVideoEnd?: DirectEventHandler<{}>; // all - onVideoAudioBecomingNoisy?: DirectEventHandler<{}>; - onVideoFullscreenPlayerWillPresent?: DirectEventHandler<{}>; // ios, android - onVideoFullscreenPlayerDidPresent?: DirectEventHandler<{}>; // ios, android - onVideoFullscreenPlayerWillDismiss?: DirectEventHandler<{}>; // ios, android - onVideoFullscreenPlayerDidDismiss?: DirectEventHandler<{}>; // ios, android - onReadyForDisplay?: DirectEventHandler<{}>; - onPlaybackRateChange?: DirectEventHandler; // all - onVolumeChange?: DirectEventHandler; // android, ios - onVideoExternalPlaybackChange?: DirectEventHandler; - onGetLicense?: DirectEventHandler; - onPictureInPictureStatusChanged?: DirectEventHandler; - onRestoreUserInterfaceForPictureInPictureStop?: DirectEventHandler<{}>; - onReceiveAdEvent?: DirectEventHandler; - onVideoPlaybackStateChanged?: DirectEventHandler; // android only - onVideoIdle?: DirectEventHandler<{}>; // android only (nowhere in document, so do not use as props. just type declaration) - onAudioFocusChanged?: DirectEventHandler; // android only (nowhere in document, so do not use as props. just type declaration) - onTimedMetadata?: DirectEventHandler; // ios, android - onAudioTracks?: DirectEventHandler; // android - onTextTracks?: DirectEventHandler; // android - onVideoTracks?: DirectEventHandler; // android -} - -export type VideoComponentType = HostComponent; - -export type VideoSaveData = { - uri: string; -}; - -export interface VideoManagerType { - save: (option: object, reactTag: number) => Promise; - setPlayerPauseState: (paused: boolean, reactTag: number) => Promise; - setLicenseResult: ( - result: string, - licenseUrl: string, - reactTag: number, - ) => Promise; - setLicenseResultError: ( - error: string, - licenseUrl: string, - reactTag: number, - ) => Promise; -} - -export interface VideoDecoderPropertiesType { - getWidevineLevel: () => Promise; - isCodecSupported: ( - mimeType: string, - width: number, - height: number, - ) => Promise<'unsupported' | 'hardware' | 'software'>; - isHEVCSupported: () => Promise<'unsupported' | 'hardware' | 'software'>; -} - -export const VideoManager = NativeModules.VideoManager as VideoManagerType; -export const VideoDecoderProperties = - NativeModules.VideoDecoderProperties as VideoDecoderPropertiesType; - -export default codegenNativeComponent( - 'RCTVideo', -) as VideoComponentType; From 10422a20b887c7ddef8755e5aac207123b57b83c Mon Sep 17 00:00:00 2001 From: yungblud Date: Tue, 23 Jan 2024 13:18:17 +0900 Subject: [PATCH 21/28] feat: git mv VideoNativeComponent.ts --- src/VideoNativeComponent.ts | 409 ----------------------- src/specs/VideoNativeComponent.ts | 536 ++++++++++++++++++++++++++++++ 2 files changed, 536 insertions(+), 409 deletions(-) delete mode 100644 src/VideoNativeComponent.ts create mode 100644 src/specs/VideoNativeComponent.ts diff --git a/src/VideoNativeComponent.ts b/src/VideoNativeComponent.ts deleted file mode 100644 index 9692356129..0000000000 --- a/src/VideoNativeComponent.ts +++ /dev/null @@ -1,409 +0,0 @@ -import type { - HostComponent, - NativeSyntheticEvent, - ViewProps, -} from 'react-native'; -import {NativeModules, requireNativeComponent} from 'react-native'; -import type ResizeMode from './types/ResizeMode'; -import type FilterType from './types/FilterType'; -import type Orientation from './types/Orientation'; -import type {AdEvent, EnumValues, OnTextTracksTypeData} from './types'; - -// -------- There are types for native component (future codegen) -------- -// if you are looking for types for react component, see src/types/video.ts - -type Headers = Record; - -type VideoSrc = Readonly<{ - uri?: string; - isNetwork?: boolean; - isAsset?: boolean; - shouldCache?: boolean; - type?: string; - mainVer?: number; - patchVer?: number; - requestHeaders?: Headers; - startPosition?: number; - cropStart?: number; - cropEnd?: number; - title?: string; - subtitle?: string; - description?: string; - customImageUri?: string; -}>; - -export type Filter = - | 'None' - | 'CIColorInvert' - | 'CIColorMonochrome' - | 'CIColorPosterize' - | 'CIFalseColor' - | 'CIMaximumComponent' - | 'CIMinimumComponent' - | 'CIPhotoEffectChrome' - | 'CIPhotoEffectFade' - | 'CIPhotoEffectInstant' - | 'CIPhotoEffectMono' - | 'CIPhotoEffectNoir' - | 'CIPhotoEffectProcess' - | 'CIPhotoEffectTonal' - | 'CIPhotoEffectTransfer' - | 'CISepiaTone'; - -export type DRMType = 'widevine' | 'playready' | 'clearkey' | 'fairplay'; - -type DebugConfig = Readonly<{ - enable?: boolean; - thread?: boolean; -}>; - -type Drm = Readonly<{ - type?: DRMType; - licenseServer?: string; - headers?: Headers; - contentId?: string; // ios - certificateUrl?: string; // ios - base64Certificate?: boolean; // ios default: false - useExternalGetLicense?: boolean; // ios -}>; - -type TextTracks = ReadonlyArray< - Readonly<{ - title: string; - language: string; - type: string; - uri: string; - }> ->; - -type TextTrackType = 'system' | 'disabled' | 'title' | 'language' | 'index'; - -type SelectedTextTrack = Readonly<{ - type: TextTrackType; - value?: string | number; -}>; - -type AudioTrackType = 'system' | 'disabled' | 'title' | 'language' | 'index'; - -type SelectedAudioTrack = Readonly<{ - type: AudioTrackType; - value?: string | number; -}>; - -export type Seek = Readonly<{ - time: number; - tolerance?: number; -}>; - -type BufferConfig = Readonly<{ - minBufferMs?: number; - maxBufferMs?: number; - bufferForPlaybackMs?: number; - bufferForPlaybackAfterRebufferMs?: number; - maxHeapAllocationPercent?: number; - minBackBufferMemoryReservePercent?: number; - minBufferMemoryReservePercent?: number; -}>; - -type SelectedVideoTrack = Readonly<{ - type: 'auto' | 'disabled' | 'resolution' | 'index'; - value?: number; -}>; - -type SubtitleStyle = Readonly<{ - fontSize?: number; - paddingTop?: number; - paddingBottom?: number; - paddingLeft?: number; - paddingRight?: number; -}>; - -export type OnLoadData = Readonly<{ - currentTime: number; - duration: number; - naturalSize: Readonly<{ - width: number; - height: number; - orientation: Orientation; - }>; -}> & - OnAudioTracksData & - OnTextTracksData; - -export type OnLoadStartData = Readonly<{ - isNetwork: boolean; - type: string; - uri: string; -}>; - -export type OnVideoAspectRatioData = Readonly<{ - width: number; - height: number; -}>; - -export type OnBufferData = Readonly<{isBuffering: boolean}>; - -export type OnProgressData = Readonly<{ - currentTime: number; - playableDuration: number; - seekableDuration: number; -}>; - -export type OnBandwidthUpdateData = Readonly<{ - bitrate: number; - width?: number; - height?: number; - trackId?: number; -}>; - -export type OnSeekData = Readonly<{ - currentTime: number; - seekTime: number; -}>; - -export type OnPlaybackStateChangedData = Readonly<{ - isPlaying: boolean; -}>; - -export type OnTimedMetadataData = Readonly<{ - metadata: ReadonlyArray< - Readonly<{ - value?: string; - identifier: string; - }> - >; -}>; - -export type OnAudioTracksData = Readonly<{ - audioTracks: ReadonlyArray< - Readonly<{ - index: number; - title?: string; - language?: string; - bitrate?: number; - type?: string; - selected?: boolean; - }> - >; -}>; - -export type OnTextTracksData = Readonly<{ - textTracks: ReadonlyArray< - Readonly<{ - index: number; - title?: string; - language?: string; - /** - * iOS only supports VTT, Android supports all 3 - */ - type?: OnTextTracksTypeData; - selected?: boolean; - }> - >; -}>; - -export type OnVideoTracksData = Readonly<{ - videoTracks: ReadonlyArray< - Readonly<{ - trackId: number; - codecs?: string; - width?: number; - height?: number; - bitrate?: number; - selected?: boolean; - }> - >; -}>; - -export type OnPlaybackData = Readonly<{ - playbackRate: number; -}>; - -export type onVolumeChangeData = Readonly<{ - volume: number; -}>; - -export type OnExternalPlaybackChangeData = Readonly<{ - isExternalPlaybackActive: boolean; -}>; - -export type OnGetLicenseData = Readonly<{ - licenseUrl: string; - contentId: string; - spcBase64: string; -}>; - -export type OnPictureInPictureStatusChangedData = Readonly<{ - isActive: boolean; -}>; - -export type OnReceiveAdEventData = Readonly<{ - data?: Record; - event: AdEvent; -}>; - -export type OnVideoErrorData = Readonly<{ - error: OnVideoErrorDataDetails; - target?: number; // ios -}>; - -export type OnVideoErrorDataDetails = Readonly<{ - errorString?: string; // android - errorException?: string; // android - errorStackTrace?: string; // android - errorCode?: string; // android - error?: string; // ios - code?: number; // ios - localizedDescription?: string; // ios - localizedFailureReason?: string; // ios - localizedRecoverySuggestion?: string; // ios - domain?: string; // ios -}>; - -export type OnAudioFocusChangedData = Readonly<{ - hasAudioFocus: boolean; -}>; - -export interface VideoNativeProps extends ViewProps { - src?: VideoSrc; - drm?: Drm; - adTagUrl?: string; - allowsExternalPlayback?: boolean; // ios, true - maxBitRate?: number; - resizeMode?: EnumValues; - repeat?: boolean; - automaticallyWaitsToMinimizeStalling?: boolean; - textTracks?: TextTracks; - selectedTextTrack?: SelectedTextTrack; - selectedAudioTrack?: SelectedAudioTrack; - paused?: boolean; - muted?: boolean; - controls?: boolean; - filter?: EnumValues; - filterEnabled?: boolean; - volume?: number; // default 1.0 - playInBackground?: boolean; - preventsDisplaySleepDuringVideoPlayback?: boolean; - preferredForwardBufferDuration?: number; //ios, 0 - playWhenInactive?: boolean; // ios, false - pictureInPicture?: boolean; // ios, false - ignoreSilentSwitch?: 'inherit' | 'ignore' | 'obey'; // ios, 'inherit' - mixWithOthers?: 'inherit' | 'mix' | 'duck'; // ios, 'inherit' - rate?: number; - fullscreen?: boolean; // ios, false - fullscreenAutorotate?: boolean; - fullscreenOrientation?: 'all' | 'landscape' | 'portrait'; - progressUpdateInterval?: number; - restoreUserInterfaceForPIPStopCompletionHandler?: boolean; - localSourceEncryptionKeyScheme?: string; - debug?: DebugConfig; - - backBufferDurationMs?: number; // Android - bufferConfig?: BufferConfig; // Android - contentStartTime?: number; // Android - currentPlaybackTime?: number; // Android - disableDisconnectError?: boolean; // Android - focusable?: boolean; // Android - hideShutterView?: boolean; // Android - minLoadRetryCount?: number; // Android - reportBandwidth?: boolean; //Android - selectedVideoTrack?: SelectedVideoTrack; // android - subtitleStyle?: SubtitleStyle; // android - trackId?: string; // Android - useTextureView?: boolean; // Android - useSecureView?: boolean; // Android - onVideoLoad?: (event: NativeSyntheticEvent) => void; - onVideoLoadStart?: (event: NativeSyntheticEvent) => void; - onVideoAspectRatio?: ( - event: NativeSyntheticEvent, - ) => void; - onVideoBuffer?: (event: NativeSyntheticEvent) => void; - onVideoError?: (event: NativeSyntheticEvent) => void; - onVideoProgress?: (event: NativeSyntheticEvent) => void; - onVideoBandwidthUpdate?: ( - event: NativeSyntheticEvent, - ) => void; - onVideoSeek?: (event: NativeSyntheticEvent) => void; - onVideoEnd?: (event: NativeSyntheticEvent>) => void; // all - onVideoAudioBecomingNoisy?: ( - event: NativeSyntheticEvent>, - ) => void; - onVideoFullscreenPlayerWillPresent?: ( - event: NativeSyntheticEvent>, - ) => void; // ios, android - onVideoFullscreenPlayerDidPresent?: ( - event: NativeSyntheticEvent>, - ) => void; // ios, android - onVideoFullscreenPlayerWillDismiss?: ( - event: NativeSyntheticEvent>, - ) => void; // ios, android - onVideoFullscreenPlayerDidDismiss?: ( - event: NativeSyntheticEvent>, - ) => void; // ios, android - onReadyForDisplay?: (event: NativeSyntheticEvent>) => void; - onPlaybackRateChange?: (event: NativeSyntheticEvent) => void; // all - onVolumeChange?: (event: NativeSyntheticEvent) => void; // android, ios - onVideoExternalPlaybackChange?: ( - event: NativeSyntheticEvent, - ) => void; - onGetLicense?: (event: NativeSyntheticEvent) => void; - onPictureInPictureStatusChanged?: ( - event: NativeSyntheticEvent, - ) => void; - onRestoreUserInterfaceForPictureInPictureStop?: ( - event: NativeSyntheticEvent>, - ) => void; - onReceiveAdEvent?: ( - event: NativeSyntheticEvent, - ) => void; - onVideoPlaybackStateChanged?: ( - event: NativeSyntheticEvent, - ) => void; // android only - onVideoIdle?: (event: NativeSyntheticEvent) => void; // android only (nowhere in document, so do not use as props. just type declaration) - onAudioFocusChanged?: ( - event: NativeSyntheticEvent, - ) => void; // android only (nowhere in document, so do not use as props. just type declaration) - onTimedMetadata?: (event: NativeSyntheticEvent) => void; // ios, android - onAudioTracks?: (event: NativeSyntheticEvent) => void; // android - onTextTracks?: (event: NativeSyntheticEvent) => void; // android - onVideoTracks?: (event: NativeSyntheticEvent) => void; // android -} - -export type VideoComponentType = HostComponent; - -export type VideoSaveData = { - uri: string; -}; - -export interface VideoManagerType { - save: (option: object, reactTag: number) => Promise; - setPlayerPauseState: (paused: boolean, reactTag: number) => Promise; - setLicenseResult: ( - result: string, - licenseUrl: string, - reactTag: number, - ) => Promise; - setLicenseResultError: ( - error: string, - licenseUrl: string, - reactTag: number, - ) => Promise; -} - -export interface VideoDecoderPropertiesType { - getWidevineLevel: () => Promise; - isCodecSupported: ( - mimeType: string, - width: number, - height: number, - ) => Promise<'unsupported' | 'hardware' | 'software'>; - isHEVCSupported: () => Promise<'unsupported' | 'hardware' | 'software'>; -} - -export const VideoManager = NativeModules.VideoManager as VideoManagerType; -export const VideoDecoderProperties = - NativeModules.VideoDecoderProperties as VideoDecoderPropertiesType; - -export default requireNativeComponent( - 'RCTVideo', -) as VideoComponentType; diff --git a/src/specs/VideoNativeComponent.ts b/src/specs/VideoNativeComponent.ts new file mode 100644 index 0000000000..05cb0605a2 --- /dev/null +++ b/src/specs/VideoNativeComponent.ts @@ -0,0 +1,536 @@ +/* eslint-disable @typescript-eslint/ban-types */ +import type {HostComponent, ViewProps} from 'react-native'; +import {NativeModules} from 'react-native'; +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import type { + DirectEventHandler, + Double, + Float, + Int32, + WithDefault, +} from 'react-native/Libraries/Types/CodegenTypes'; + +// -------- There are types for native component (future codegen) -------- +// if you are looking for types for react component, see src/types/video.ts + +type Headers = ReadonlyArray< + Readonly<{ + key: string; + value: string; + }> +>; + +export type VideoSrc = Readonly<{ + uri?: string; + isNetwork?: boolean; + isAsset?: boolean; + shouldCache?: boolean; + type?: string; + mainVer?: Int32; + patchVer?: Int32; + requestHeaders?: Headers; + startPosition?: Float; + cropStart?: Float; + cropEnd?: Float; + title?: string; + subtitle?: string; + description?: string; + customImageUri?: string; +}>; + +export type DRMType = WithDefault< + 'widevine' | 'playready' | 'clearkey' | 'fairplay', + 'widevine' +>; + +type DebugConfig = Readonly<{ + enable?: boolean; + thread?: boolean; +}>; + +type Drm = Readonly<{ + type?: DRMType; + licenseServer?: string; + headers?: Headers; + contentId?: string; // ios + certificateUrl?: string; // ios + base64Certificate?: boolean; // ios default: false + useExternalGetLicense?: boolean; // ios +}>; + +type TextTracks = ReadonlyArray< + Readonly<{ + title: string; + language: string; + type: string; + uri: string; + }> +>; + +type SelectedTrack = WithDefault< + 'system' | 'disabled' | 'title' | 'language' | 'index', + 'system' +>; + +export type SelectedTrackType = Readonly<{ + type?: SelectedTrack; + value?: string; +}>; + +export type Seek = Readonly<{ + time: Float; + tolerance?: Float; +}>; + +type BufferConfig = Readonly<{ + minBufferMs?: Float; + maxBufferMs?: Float; + bufferForPlaybackMs?: Float; + bufferForPlaybackAfterRebufferMs?: Float; + maxHeapAllocationPercent?: Float; + minBackBufferMemoryReservePercent?: Float; + minBufferMemoryReservePercent?: Float; +}>; + +type SelectedVideoTrack = WithDefault< + 'auto' | 'disabled' | 'resolution' | 'index', + 'auto' +>; + +export type SelectedVideoTrackType = Readonly<{ + type?: SelectedVideoTrack; + value?: Int32; +}>; + +type SubtitleStyle = Readonly<{ + fontSize?: Float; + paddingTop?: WithDefault; + paddingBottom?: WithDefault; + paddingLeft?: WithDefault; + paddingRight?: WithDefault; +}>; + +export type OnLoadData = Readonly<{ + currentTime: Float; + duration: Float; + naturalSize: Readonly<{ + width: Float; + height: Float; + orientation: WithDefault<'landscape' | 'portrait', 'landscape'>; + }>; + audioTracks: Readonly<{}>; + textTracks: Readonly<{}>; +}>; + +export type OnLoadStartData = Readonly<{ + isNetwork: boolean; + type: string; + uri: string; +}>; + +export type OnVideoAspectRatioData = Readonly<{ + width: Float; + height: Float; +}>; + +export type OnBufferData = Readonly<{isBuffering: boolean}>; + +export type OnProgressData = Readonly<{ + currentTime: Float; + playableDuration: Float; + seekableDuration: Float; +}>; + +export type OnBandwidthUpdateData = Readonly<{ + bitrate: Int32; + width?: Float; + height?: Float; + trackId?: Int32; +}>; + +export type OnSeekData = Readonly<{ + currentTime: Float; + seekTime: Float; +}>; + +export type OnPlaybackStateChangedData = Readonly<{ + isPlaying: boolean; +}>; + +export type OnTimedMetadataData = Readonly<{ + metadata: { + value?: string; + identifier: string; + }[]; +}>; + +export type OnAudioTracksData = Readonly<{ + audioTracks: { + index: Int32; + title?: string; + language?: string; + bitrate?: Float; + type?: string; + selected?: boolean; + }[]; +}>; + +export type OnTextTracksData = Readonly<{ + textTracks: { + index: Int32; + title?: string; + language?: string; + /** + * iOS only supports VTT, Android supports all 3 + */ + type?: WithDefault<'srt' | 'ttml' | 'vtt', 'srt'>; + selected?: boolean; + }[]; +}>; + +export type OnVideoTracksData = Readonly<{ + videoTracks: { + trackId: Int32; + codecs?: string; + width?: Float; + height?: Float; + bitrate?: Float; + selected?: boolean; + }[]; +}>; + +export type OnPlaybackData = Readonly<{ + playbackRate: Float; +}>; + +export type OnVolumeChangeData = Readonly<{ + volume: Float; +}>; + +export type OnExternalPlaybackChangeData = Readonly<{ + isExternalPlaybackActive: boolean; +}>; + +export type OnGetLicenseData = Readonly<{ + licenseUrl: string; + contentId: string; + spcBase64: string; +}>; + +export type OnPictureInPictureStatusChangedData = Readonly<{ + isActive: boolean; +}>; + +export type OnReceiveAdEventData = Readonly<{ + data?: {}; + event: WithDefault< + /** + * iOS only: Fired the first time each ad break ends. Applications must reenable seeking when this occurs (only used for dynamic ad insertion). + */ | 'AD_BREAK_ENDED' + /** + * Fires when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false. + */ + | 'AD_BREAK_READY' + /** + * iOS only: Fired first time each ad break begins playback. If an ad break is watched subsequent times this will not be fired. Applications must disable seeking when this occurs (only used for dynamic ad insertion). + */ + | 'AD_BREAK_STARTED' + /** + * Android only: Fires when the ad has stalled playback to buffer. + */ + | 'AD_BUFFERING' + /** + * Android only: Fires when the ad is ready to play without buffering, either at the beginning of the ad or after buffering completes. + */ + | 'AD_CAN_PLAY' + /** + * Android only: Fires when an ads list is loaded. + */ + | 'AD_METADATA' + /** + * iOS only: Fired every time the stream switches from advertising or slate to content. This will be fired even when an ad is played a second time or when seeking into an ad (only used for dynamic ad insertion). + */ + | 'AD_PERIOD_ENDED' + /** + * iOS only: Fired every time the stream switches from content to advertising or slate. This will be fired even when an ad is played a second time or when seeking into an ad (only used for dynamic ad insertion). + */ + | 'AD_PERIOD_STARTED' + /** + * Android only: Fires when the ad's current time value changes. The event `data` will be populated with an AdProgressData object. + */ + | 'AD_PROGRESS' + /** + * Fires when the ads manager is done playing all the valid ads in the ads response, or when the response doesn't return any valid ads. + */ + | 'ALL_ADS_COMPLETED' + /** + * Fires when the ad is clicked. + */ + | 'CLICK' + /** + * Fires when the ad completes playing. + */ + | 'COMPLETED' + /** + * Android only: Fires when content should be paused. This usually happens right before an ad is about to cover the content. + */ + | 'CONTENT_PAUSE_REQUESTED' + /** + * Android only: Fires when content should be resumed. This usually happens when an ad finishes or collapses. + */ + | 'CONTENT_RESUME_REQUESTED' + /** + * iOS only: Cuepoints changed for VOD stream (only used for dynamic ad insertion). + */ + | 'CUEPOINTS_CHANGED' + /** + * Android only: Fires when the ad's duration changes. + */ + | 'DURATION_CHANGE' + /** + * Fires when an error is encountered and the ad can't be played. + */ + | 'ERROR' + /** + * Fires when the ad playhead crosses first quartile. + */ + | 'FIRST_QUARTILE' + /** + * Android only: Fires when the impression URL has been pinged. + */ + | 'IMPRESSION' + /** + * Android only: Fires when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data. + */ + | 'INTERACTION' + /** + * Android only: Fires when the displayed ad changes from linear to nonlinear, or the reverse. + */ + | 'LINEAR_CHANGED' + /** + * Fires when ad data is available. + */ + | 'LOADED' + /** + * Fires when a non-fatal error is encountered. The user need not take any action since the SDK will continue with the same or next ad playback depending on the error situation. + */ + | 'LOG' + /** + * Fires when the ad playhead crosses midpoint. + */ + | 'MIDPOINT' + /** + * Fires when the ad is paused. + */ + | 'PAUSED' + /** + * Fires when the ad is resumed. + */ + | 'RESUMED' + /** + * Android only: Fires when the displayed ads skippable state is changed. + */ + | 'SKIPPABLE_STATE_CHANGED' + /** + * Fires when the ad is skipped by the user. + */ + | 'SKIPPED' + /** + * Fires when the ad starts playing. + */ + | 'STARTED' + /** + * iOS only: Stream request has loaded (only used for dynamic ad insertion). + */ + | 'STREAM_LOADED' + /** + * iOS only: Fires when the ad is tapped. + */ + | 'TAPPED' + /** + * Fires when the ad playhead crosses third quartile. + */ + | 'THIRD_QUARTILE' + /** + * iOS only: An unknown event has fired + */ + | 'UNKNOWN' + /** + * Android only: Fires when the ad is closed by the user. + */ + | 'USER_CLOSE' + /** + * Android only: Fires when the non-clickthrough portion of a video ad is clicked. + */ + | 'VIDEO_CLICKED' + /** + * Android only: Fires when a user clicks a video icon. + */ + | 'VIDEO_ICON_CLICKED' + /** + * Android only: Fires when the ad volume has changed. + */ + | 'VOLUME_CHANGED' + /** + * Android only: Fires when the ad volume has been muted. + */ + | 'VOLUME_MUTED', + 'AD_BREAK_ENDED' + >; +}>; + +export type OnVideoErrorData = Readonly<{ + error: Readonly<{ + errorString?: string; // android + errorException?: string; // android + errorStackTrace?: string; // android + errorCode?: string; // android + error?: string; // ios + code?: Int32; // ios + localizedDescription?: string; // ios + localizedFailureReason?: string; // ios + localizedRecoverySuggestion?: string; // ios + domain?: string; // ios + }>; + target?: Int32; // ios +}>; + +export type OnAudioFocusChangedData = Readonly<{ + hasAudioFocus: boolean; +}>; + +export interface VideoNativeProps extends ViewProps { + src?: VideoSrc; + drm?: Drm; + adTagUrl?: string; + allowsExternalPlayback?: boolean; // ios, true + maxBitRate?: Float; + resizeMode?: WithDefault<'none' | 'contain' | 'cover' | 'stretch', 'none'>; + repeat?: boolean; + automaticallyWaitsToMinimizeStalling?: boolean; + textTracks?: TextTracks; + selectedTextTrack?: SelectedTrackType; + selectedAudioTrack?: SelectedTrackType; + paused?: boolean; + muted?: boolean; + controls?: boolean; + filter?: WithDefault< + | '' + | 'CIColorInvert' + | 'CIColorMonochrome' + | 'CIColorPosterize' + | 'CIFalseColor' + | 'CIMaximumComponent' + | 'CIMinimumComponent' + | 'CIPhotoEffectChrome' + | 'CIPhotoEffectFade' + | 'CIPhotoEffectInstant' + | 'CIPhotoEffectMono' + | 'CIPhotoEffectNoir' + | 'CIPhotoEffectProcess' + | 'CIPhotoEffectTonal' + | 'CIPhotoEffectTransfer' + | 'CISepiaTone', + '' + >; + filterEnabled?: boolean; + volume?: Float; // default 1.0 + playInBackground?: boolean; + preventsDisplaySleepDuringVideoPlayback?: boolean; + preferredForwardBufferDuration?: Float; //ios, 0 + playWhenInactive?: boolean; // ios, false + pictureInPicture?: boolean; // ios, false + ignoreSilentSwitch?: WithDefault<'inherit' | 'ignore' | 'obey', 'inherit'>; // ios, 'inherit' + mixWithOthers?: WithDefault<'inherit' | 'mix' | 'duck', 'inherit'>; // ios, 'inherit' + rate?: Float; + fullscreen?: boolean; // ios, false + fullscreenAutorotate?: boolean; + fullscreenOrientation?: WithDefault<'all' | 'landscape' | 'portrait', 'all'>; + progressUpdateInterval?: Float; + restoreUserInterfaceForPIPStopCompletionHandler?: boolean; + localSourceEncryptionKeyScheme?: string; + debug?: DebugConfig; + + backBufferDurationMs?: Int32; // Android + bufferConfig?: BufferConfig; // Android + contentStartTime?: Int32; // Android + currentPlaybackTime?: Double; // Android + disableDisconnectError?: boolean; // Android + focusable?: boolean; // Android + hideShutterView?: boolean; // Android + minLoadRetryCount?: Int32; // Android + reportBandwidth?: boolean; //Android + selectedVideoTrack?: SelectedVideoTrackType; // android + subtitleStyle?: SubtitleStyle; // android + trackId?: string; // Android + useTextureView?: boolean; // Android + useSecureView?: boolean; // Android + onVideoLoad?: DirectEventHandler; + onVideoLoadStart?: DirectEventHandler; + onVideoAspectRatio?: DirectEventHandler; + onVideoBuffer?: DirectEventHandler; + onVideoError?: DirectEventHandler; + onVideoProgress?: DirectEventHandler; + onVideoBandwidthUpdate?: DirectEventHandler; + onVideoSeek?: DirectEventHandler; + onVideoEnd?: DirectEventHandler<{}>; // all + onVideoAudioBecomingNoisy?: DirectEventHandler<{}>; + onVideoFullscreenPlayerWillPresent?: DirectEventHandler<{}>; // ios, android + onVideoFullscreenPlayerDidPresent?: DirectEventHandler<{}>; // ios, android + onVideoFullscreenPlayerWillDismiss?: DirectEventHandler<{}>; // ios, android + onVideoFullscreenPlayerDidDismiss?: DirectEventHandler<{}>; // ios, android + onReadyForDisplay?: DirectEventHandler<{}>; + onPlaybackRateChange?: DirectEventHandler; // all + onVolumeChange?: DirectEventHandler; // android, ios + onVideoExternalPlaybackChange?: DirectEventHandler; + onGetLicense?: DirectEventHandler; + onPictureInPictureStatusChanged?: DirectEventHandler; + onRestoreUserInterfaceForPictureInPictureStop?: DirectEventHandler<{}>; + onReceiveAdEvent?: DirectEventHandler; + onVideoPlaybackStateChanged?: DirectEventHandler; // android only + onVideoIdle?: DirectEventHandler<{}>; // android only (nowhere in document, so do not use as props. just type declaration) + onAudioFocusChanged?: DirectEventHandler; // android only (nowhere in document, so do not use as props. just type declaration) + onTimedMetadata?: DirectEventHandler; // ios, android + onAudioTracks?: DirectEventHandler; // android + onTextTracks?: DirectEventHandler; // android + onVideoTracks?: DirectEventHandler; // android +} + +export type VideoComponentType = HostComponent; + +export type VideoSaveData = { + uri: string; +}; + +export interface VideoManagerType { + save: (option: object, reactTag: number) => Promise; + setPlayerPauseState: (paused: boolean, reactTag: number) => Promise; + setLicenseResult: ( + result: string, + licenseUrl: string, + reactTag: number, + ) => Promise; + setLicenseResultError: ( + error: string, + licenseUrl: string, + reactTag: number, + ) => Promise; +} + +export interface VideoDecoderPropertiesType { + getWidevineLevel: () => Promise; + isCodecSupported: ( + mimeType: string, + width: number, + height: number, + ) => Promise<'unsupported' | 'hardware' | 'software'>; + isHEVCSupported: () => Promise<'unsupported' | 'hardware' | 'software'>; +} + +export const VideoManager = NativeModules.VideoManager as VideoManagerType; +export const VideoDecoderProperties = + NativeModules.VideoDecoderProperties as VideoDecoderPropertiesType; + +export default codegenNativeComponent( + 'RCTVideo', +) as VideoComponentType; From 1a99d301c740c2d088f81f5e977ea27eb8fcf446 Mon Sep 17 00:00:00 2001 From: yungblud Date: Tue, 23 Jan 2024 13:19:48 +0900 Subject: [PATCH 22/28] feat: git mv src/specs/VideoNativeComponent.ts --- src/{specs => }/VideoNativeComponent.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{specs => }/VideoNativeComponent.ts (100%) diff --git a/src/specs/VideoNativeComponent.ts b/src/VideoNativeComponent.ts similarity index 100% rename from src/specs/VideoNativeComponent.ts rename to src/VideoNativeComponent.ts From 5287d693a4c10c30132eff1c673a4cb9c2f1cbcb Mon Sep 17 00:00:00 2001 From: yungblud Date: Tue, 23 Jan 2024 13:22:00 +0900 Subject: [PATCH 23/28] feat: git mv src/VideoNativeComponent.ts src/specs/VideoNativeComponent.ts --- src/{ => specs}/VideoNativeComponent.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{ => specs}/VideoNativeComponent.ts (100%) diff --git a/src/VideoNativeComponent.ts b/src/specs/VideoNativeComponent.ts similarity index 100% rename from src/VideoNativeComponent.ts rename to src/specs/VideoNativeComponent.ts From 67c648ef079c22e975c63004bde6c4f6667e6882 Mon Sep 17 00:00:00 2001 From: yungblud Date: Thu, 25 Jan 2024 14:28:26 +0900 Subject: [PATCH 24/28] feat: implemented array type handling on android JAVA --- .../exoplayer/ReactExoplayerViewManager.java | 28 ++++++++++++++----- .../ios/videoplayer.xcodeproj/project.pbxproj | 6 ++++ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java index 8536bc2b5c..6433e96bd9 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java @@ -128,18 +128,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 = (drm.hasKey(PROP_DRM_HEADERS)) ? drm.getArray(PROP_DRM_HEADERS) : null; 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 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])); } @@ -157,7 +158,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 headers = src.hasKey(PROP_SRC_HEADERS) ? ReactBridgeUtils.toStringMap(src.getMap(PROP_SRC_HEADERS)) : new HashMap<>(); + Map headers = new HashMap<>(); + ReadableArray propSrcHeadersArray = (src.hasKey(PROP_SRC_HEADERS)) ? src.getArray(PROP_SRC_HEADERS) : null; + 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(); diff --git a/examples/basic/ios/videoplayer.xcodeproj/project.pbxproj b/examples/basic/ios/videoplayer.xcodeproj/project.pbxproj index 91fb7fbffe..a86577c6b4 100644 --- a/examples/basic/ios/videoplayer.xcodeproj/project.pbxproj +++ b/examples/basic/ios/videoplayer.xcodeproj/project.pbxproj @@ -597,6 +597,9 @@ " ${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 = ( @@ -686,6 +689,9 @@ " ${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 = ( From 6c0fe6885fcbeca107174fe3040ee4812eab74b9 Mon Sep 17 00:00:00 2001 From: yungblud Date: Tue, 30 Jan 2024 13:34:02 +0900 Subject: [PATCH 25/28] feat: updated iOS requestHeaders parsing native --- ios/Video/DataStructures/VideoSource.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ios/Video/DataStructures/VideoSource.swift b/ios/Video/DataStructures/VideoSource.swift index e9495a3325..e2b83bb8e6 100644 --- a/ios/Video/DataStructures/VideoSource.swift +++ b/ios/Video/DataStructures/VideoSource.swift @@ -40,7 +40,17 @@ struct VideoSource { self.isNetwork = json["isNetwork"] as? Bool ?? false self.isAsset = json["isAsset"] as? Bool ?? false self.shouldCache = json["shouldCache"] as? Bool ?? false - self.requestHeaders = json["requestHeaders"] as? [String: Any] + if let requestHeaders = json["requestHeaders"] as? [[String: Any]] { + var _requestHeaders: [String: Any] = [:] + for requestHeader in requestHeaders { + if let key = requestHeader["key"] as? String, let value = requestHeader["value"] { + _requestHeaders[key] = value + } + } + self.requestHeaders = _requestHeaders + } else { + self.requestHeaders = nil + } self.startPosition = json["startPosition"] as? Int64 self.cropStart = json["cropStart"] as? Int64 self.cropEnd = json["cropEnd"] as? Int64 From e69666d2458b262e52d2ba01775426a8e224cf4b Mon Sep 17 00:00:00 2001 From: yungblud Date: Tue, 30 Jan 2024 13:41:44 +0900 Subject: [PATCH 26/28] feat: use safeGetArray on android, removed not using import too --- .../com/brentvatne/exoplayer/ReactExoplayerViewManager.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java index 6433e96bd9..ee69b28d45 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java @@ -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; @@ -128,7 +127,7 @@ 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); - ReadableArray drmHeadersArray = (drm.hasKey(PROP_DRM_HEADERS)) ? drm.getArray(PROP_DRM_HEADERS) : null; + 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); @@ -159,7 +158,7 @@ public void setSrc(final ReactExoplayerView videoView, @Nullable ReadableMap src String extension = ReactBridgeUtils.safeGetString(src, PROP_SRC_TYPE, null); Map headers = new HashMap<>(); - ReadableArray propSrcHeadersArray = (src.hasKey(PROP_SRC_HEADERS)) ? src.getArray(PROP_SRC_HEADERS) : null; + ReadableArray propSrcHeadersArray = ReactBridgeUtils.safeGetArray(src, PROP_SRC_HEADERS); if (propSrcHeadersArray != null) { if (propSrcHeadersArray.size() > 0) { for (int i = 0; i < propSrcHeadersArray.size(); i++) { From d1a858a590339b48d5430fbe8b8769f8f1921bd6 Mon Sep 17 00:00:00 2001 From: yungblud Date: Tue, 30 Jan 2024 14:11:17 +0900 Subject: [PATCH 27/28] feat: temporary commit - reusing enum types for remaining docs types --- src/specs/VideoNativeComponent.ts | 64 ++++++++++++++++++++++--------- src/types/events.ts | 3 ++ src/types/index.ts | 1 + src/types/video.ts | 35 +++++++++++++---- 4 files changed, 77 insertions(+), 26 deletions(-) diff --git a/src/specs/VideoNativeComponent.ts b/src/specs/VideoNativeComponent.ts index 05cb0605a2..6c6c7f4818 100644 --- a/src/specs/VideoNativeComponent.ts +++ b/src/specs/VideoNativeComponent.ts @@ -38,7 +38,7 @@ export type VideoSrc = Readonly<{ customImageUri?: string; }>; -export type DRMType = WithDefault< +type DRMType = WithDefault< 'widevine' | 'playready' | 'clearkey' | 'fairplay', 'widevine' >; @@ -67,16 +67,36 @@ type TextTracks = ReadonlyArray< }> >; -type SelectedTrack = WithDefault< +type SelectedTextTrackType = WithDefault< 'system' | 'disabled' | 'title' | 'language' | 'index', 'system' >; -export type SelectedTrackType = Readonly<{ - type?: SelectedTrack; +type SelectedAudioTrackType = WithDefault< + 'system' | 'disabled' | 'title' | 'language' | 'index', + 'system' +>; + +type SelectedTextTrack = Readonly<{ + type?: SelectedTextTrackType; + value?: string; +}>; + +type SelectedAudioTrack = Readonly<{ + type?: SelectedAudioTrackType; value?: string; }>; +type SelectedVideoTrackType = WithDefault< + 'auto' | 'disabled' | 'resolution' | 'index', + 'auto' +>; + +type SelectedVideoTrack = Readonly<{ + type?: SelectedVideoTrackType; + value?: Int32; +}>; + export type Seek = Readonly<{ time: Float; tolerance?: Float; @@ -92,16 +112,6 @@ type BufferConfig = Readonly<{ minBufferMemoryReservePercent?: Float; }>; -type SelectedVideoTrack = WithDefault< - 'auto' | 'disabled' | 'resolution' | 'index', - 'auto' ->; - -export type SelectedVideoTrackType = Readonly<{ - type?: SelectedVideoTrack; - value?: Int32; -}>; - type SubtitleStyle = Readonly<{ fontSize?: Float; paddingTop?: WithDefault; @@ -118,8 +128,24 @@ export type OnLoadData = Readonly<{ height: Float; orientation: WithDefault<'landscape' | 'portrait', 'landscape'>; }>; - audioTracks: Readonly<{}>; - textTracks: Readonly<{}>; + audioTracks: { + index: Int32; + title?: string; + language?: string; + bitrate?: Float; + type?: string; + selected?: boolean; + }[]; + textTracks: { + index: Int32; + title?: string; + language?: string; + /** + * iOS only supports VTT, Android supports all 3 + */ + type?: WithDefault<'srt' | 'ttml' | 'vtt', 'srt'>; + selected?: boolean; + }[]; }>; export type OnLoadStartData = Readonly<{ @@ -409,8 +435,9 @@ export interface VideoNativeProps extends ViewProps { repeat?: boolean; automaticallyWaitsToMinimizeStalling?: boolean; textTracks?: TextTracks; - selectedTextTrack?: SelectedTrackType; - selectedAudioTrack?: SelectedTrackType; + selectedTextTrack?: SelectedTextTrack; + selectedAudioTrack?: SelectedAudioTrack; + selectedVideoTrack?: SelectedVideoTrack; // android paused?: boolean; muted?: boolean; controls?: boolean; @@ -460,7 +487,6 @@ export interface VideoNativeProps extends ViewProps { hideShutterView?: boolean; // Android minLoadRetryCount?: Int32; // Android reportBandwidth?: boolean; //Android - selectedVideoTrack?: SelectedVideoTrackType; // android subtitleStyle?: SubtitleStyle; // android trackId?: string; // Android useTextureView?: boolean; // Android diff --git a/src/types/events.ts b/src/types/events.ts index 19933cbd6a..f510c98717 100644 --- a/src/types/events.ts +++ b/src/types/events.ts @@ -20,6 +20,9 @@ import type { OnVolumeChangeData, } from '../specs/VideoNativeComponent'; +export type AudioTrack = OnAudioTracksData['audioTracks'][number]; +export type TextTrack = OnTextTracksData['textTracks'][number]; + export interface ReactVideoEvents { onAudioBecomingNoisy?: () => void; //Android, iOS onAudioFocusChanged?: (e: OnAudioFocusChangedData) => void; // Android diff --git a/src/types/index.ts b/src/types/index.ts index e530a5069f..5742eac029 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -6,3 +6,4 @@ export {default as Orientation} from './Orientation'; export {default as ResizeMode} from './ResizeMode'; export {default as TextTrackType} from './TextTrackType'; export * from './video'; +export * from '../specs/VideoNativeComponent'; diff --git a/src/types/video.ts b/src/types/video.ts index 711d7d6424..234537c9f8 100644 --- a/src/types/video.ts +++ b/src/types/video.ts @@ -3,10 +3,6 @@ import type {ReactVideoEvents} from './events'; import type {StyleProp, ViewProps, ViewStyle} from 'react-native'; import type VideoResizeMode from './ResizeMode'; import type FilterType from './FilterType'; -import type { - SelectedTrackType, - SelectedVideoTrackType, -} from '../specs/VideoNativeComponent'; export type Headers = Record; @@ -74,6 +70,31 @@ export type BufferConfig = { minBufferMemoryReservePercent?: number; }; +export enum SelectedTrackType { + SYSTEM = 'system', + DISABLED = 'disabled', + TITLE = 'title', + LANGUAGE = 'language', + INDEX = 'index', +} + +export type SelectedTrack = { + type: SelectedTrackType; + value?: string; +}; + +export enum SelectedVideoTrackType { + AUTO = 'auto', + DISABLED = 'disabled', + RESOLUTION = 'resolution', + INDEX = 'index', +} + +export type SelectedVideoTrack = { + type: SelectedVideoTrackType; + value?: number; +}; + export type SubtitleStyle = { fontSize?: number; paddingTop?: number; @@ -196,9 +217,9 @@ export interface ReactVideoProps extends ReactVideoEvents, ViewProps { repeat?: boolean; reportBandwidth?: boolean; //Android resizeMode?: EnumValues; - selectedAudioTrack?: SelectedTrackType; - selectedTextTrack?: SelectedTrackType; - selectedVideoTrack?: SelectedVideoTrackType; // android + selectedAudioTrack?: SelectedTrack; + selectedTextTrack?: SelectedTrack; + selectedVideoTrack?: SelectedVideoTrack; // android subtitleStyle?: SubtitleStyle; // android textTracks?: TextTracks; testID?: string; From 2ef456a23206201b444c50bd316d42677048dca0 Mon Sep 17 00:00:00 2001 From: yungblud Date: Wed, 7 Feb 2024 12:22:27 +0900 Subject: [PATCH 28/28] feat: implemented mixed type of SelectedTrack.value for JS layer --- src/Video.tsx | 10 ++++++++-- src/types/video.ts | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Video.tsx b/src/Video.tsx index 868a656964..582d24ea55 100644 --- a/src/Video.tsx +++ b/src/Video.tsx @@ -180,10 +180,13 @@ const Video = forwardRef( if (!selectedTextTrack) { return; } + const value = selectedTextTrack.value + ? `${selectedTextTrack.value}` + : undefined; return { type: selectedTextTrack?.type, - value: selectedTextTrack?.value, + value, }; }, [selectedTextTrack]); @@ -191,10 +194,13 @@ const Video = forwardRef( if (!selectedAudioTrack) { return; } + const value = selectedAudioTrack.value + ? `${selectedAudioTrack.value}` + : undefined; return { type: selectedAudioTrack?.type, - value: selectedAudioTrack?.value, + value, }; }, [selectedAudioTrack]); diff --git a/src/types/video.ts b/src/types/video.ts index 234537c9f8..415c69c530 100644 --- a/src/types/video.ts +++ b/src/types/video.ts @@ -80,7 +80,7 @@ export enum SelectedTrackType { export type SelectedTrack = { type: SelectedTrackType; - value?: string; + value?: string | number; }; export enum SelectedVideoTrackType {