mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-05-31 02:07:41 +00:00
fix: codegen config (#4616)
This commit is contained in:
@@ -1565,7 +1565,7 @@ PODS:
|
|||||||
- React-logger (= 0.77.2)
|
- React-logger (= 0.77.2)
|
||||||
- React-perflogger (= 0.77.2)
|
- React-perflogger (= 0.77.2)
|
||||||
- React-utils (= 0.77.2)
|
- React-utils (= 0.77.2)
|
||||||
- ReactNativeVideo (7.0.0-alpha.0):
|
- ReactNativeVideo (7.0.0-alpha.1):
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- glog
|
- glog
|
||||||
- hermes-engine
|
- hermes-engine
|
||||||
@@ -1876,7 +1876,7 @@ SPEC CHECKSUMS:
|
|||||||
ReactAppDependencyProvider: f334cebc0beed0a72490492e978007082c03d533
|
ReactAppDependencyProvider: f334cebc0beed0a72490492e978007082c03d533
|
||||||
ReactCodegen: 474fbb3e4bb0f1ee6c255d1955db76e13d509269
|
ReactCodegen: 474fbb3e4bb0f1ee6c255d1955db76e13d509269
|
||||||
ReactCommon: 7763e59534d58e15f8f22121cdfe319040e08888
|
ReactCommon: 7763e59534d58e15f8f22121cdfe319040e08888
|
||||||
ReactNativeVideo: 8de1c56f95b9137b7c8f416982488a6d321a6542
|
ReactNativeVideo: ccaea22f81a6b60376e8bdb024368a2b5df400f6
|
||||||
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
|
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
|
||||||
Yoga: 31a098f74c16780569aebd614a0f37a907de0189
|
Yoga: 31a098f74c16780569aebd614a0f37a907de0189
|
||||||
|
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ dependencies {
|
|||||||
if (isNewArchitectureEnabled()) {
|
if (isNewArchitectureEnabled()) {
|
||||||
react {
|
react {
|
||||||
jsRootDir = file("../src/spec/fabric")
|
jsRootDir = file("../src/spec/fabric")
|
||||||
libraryName = "VideoView"
|
libraryName = "RNCVideoView"
|
||||||
codegenJavaPackageName = "com.video"
|
codegenJavaPackageName = "com.video"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -11,8 +11,8 @@ import com.facebook.react.uimanager.UIManagerHelper
|
|||||||
import com.facebook.react.uimanager.ViewManagerDelegate
|
import com.facebook.react.uimanager.ViewManagerDelegate
|
||||||
import com.facebook.react.uimanager.annotations.ReactProp
|
import com.facebook.react.uimanager.annotations.ReactProp
|
||||||
import com.facebook.react.uimanager.events.Event
|
import com.facebook.react.uimanager.events.Event
|
||||||
import com.facebook.react.viewmanagers.VideoViewManagerDelegate
|
import com.facebook.react.viewmanagers.RNCVideoViewManagerDelegate
|
||||||
import com.facebook.react.viewmanagers.VideoViewManagerInterface
|
import com.facebook.react.viewmanagers.RNCVideoViewManagerInterface
|
||||||
import com.video.view.VideoView
|
import com.video.view.VideoView
|
||||||
|
|
||||||
internal class NitroIdChange(
|
internal class NitroIdChange(
|
||||||
@@ -33,11 +33,11 @@ internal class NitroIdChange(
|
|||||||
|
|
||||||
@UnstableApi
|
@UnstableApi
|
||||||
@ReactModule(name = VideoViewViewManager.NAME)
|
@ReactModule(name = VideoViewViewManager.NAME)
|
||||||
class VideoViewViewManager : SimpleViewManager<VideoView>(), VideoViewManagerInterface<VideoView> {
|
class VideoViewViewManager : SimpleViewManager<VideoView>(), RNCVideoViewManagerInterface<VideoView> {
|
||||||
private val mDelegate: ViewManagerDelegate<VideoView>
|
private val mDelegate: ViewManagerDelegate<VideoView>
|
||||||
|
|
||||||
init {
|
init {
|
||||||
mDelegate = VideoViewManagerDelegate(this)
|
mDelegate = RNCVideoViewManagerDelegate(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ReactProp(name = "nitroId")
|
@ReactProp(name = "nitroId")
|
||||||
@@ -73,6 +73,6 @@ class VideoViewViewManager : SimpleViewManager<VideoView>(), VideoViewManagerInt
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val NAME = "VideoView"
|
const val NAME = "RNCVideoView"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -15,8 +15,8 @@ import com.facebook.react.uimanager.BaseViewManager;
|
|||||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||||
|
|
||||||
public class VideoViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & VideoViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
public class RNCVideoViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RNCVideoViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||||
public VideoViewManagerDelegate(U viewManager) {
|
public RNCVideoViewManagerDelegate(U viewManager) {
|
||||||
super(viewManager);
|
super(viewManager);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
+1
-1
@@ -11,6 +11,6 @@ package com.facebook.react.viewmanagers;
|
|||||||
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
public interface VideoViewManagerInterface<T extends View> {
|
public interface RNCVideoViewManagerInterface<T extends View> {
|
||||||
void setNitroId(T view, int value);
|
void setNitroId(T view, int value);
|
||||||
}
|
}
|
||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface VideoView : RCTViewComponentView
|
@interface RCTVideoViewComponentView : RCTViewComponentView
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
+14
-14
@@ -1,9 +1,9 @@
|
|||||||
#import "VideoView.h"
|
#import "RCTVideoViewComponentView.h"
|
||||||
|
|
||||||
#import <react/renderer/components/RNVideoViewSpec/ComponentDescriptors.h>
|
#import <react/renderer/components/RNCVideoViewSpec/ComponentDescriptors.h>
|
||||||
#import <react/renderer/components/RNVideoViewSpec/EventEmitters.h>
|
#import <react/renderer/components/RNCVideoViewSpec/EventEmitters.h>
|
||||||
#import <react/renderer/components/RNVideoViewSpec/Props.h>
|
#import <react/renderer/components/RNCVideoViewSpec/Props.h>
|
||||||
#import <react/renderer/components/RNVideoViewSpec/RCTComponentViewHelpers.h>
|
#import <react/renderer/components/RNCVideoViewSpec/RCTComponentViewHelpers.h>
|
||||||
|
|
||||||
#import "RCTFabricComponentsPlugins.h"
|
#import "RCTFabricComponentsPlugins.h"
|
||||||
|
|
||||||
@@ -17,10 +17,10 @@
|
|||||||
|
|
||||||
using namespace facebook::react;
|
using namespace facebook::react;
|
||||||
|
|
||||||
@interface VideoView () <RCTVideoViewViewProtocol>
|
@interface RCTVideoViewComponentView () <RCTRNCVideoViewViewProtocol>
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation VideoView {
|
@implementation RCTVideoViewComponentView {
|
||||||
VideoComponentView * _view;
|
VideoComponentView * _view;
|
||||||
int _nitroId;
|
int _nitroId;
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ using namespace facebook::react;
|
|||||||
- (instancetype)initWithFrame:(CGRect)frame
|
- (instancetype)initWithFrame:(CGRect)frame
|
||||||
{
|
{
|
||||||
if (self = [super initWithFrame:frame]) {
|
if (self = [super initWithFrame:frame]) {
|
||||||
static const auto defaultProps = std::make_shared<const VideoViewProps>();
|
static const auto defaultProps = std::make_shared<const RNCVideoViewProps>();
|
||||||
_props = defaultProps;
|
_props = defaultProps;
|
||||||
|
|
||||||
_view = [[VideoComponentView alloc] initWithFrame:frame];
|
_view = [[VideoComponentView alloc] initWithFrame:frame];
|
||||||
@@ -44,8 +44,8 @@ using namespace facebook::react;
|
|||||||
|
|
||||||
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
||||||
{
|
{
|
||||||
const auto &oldViewProps = *std::static_pointer_cast<VideoViewProps const>(_props);
|
const auto &oldViewProps = *std::static_pointer_cast<RNCVideoViewProps const>(_props);
|
||||||
const auto &newViewProps = *std::static_pointer_cast<VideoViewProps const>(props);
|
const auto &newViewProps = *std::static_pointer_cast<RNCVideoViewProps const>(props);
|
||||||
|
|
||||||
if (oldViewProps.nitroId != newViewProps.nitroId) {
|
if (oldViewProps.nitroId != newViewProps.nitroId) {
|
||||||
[self setNitroId:newViewProps.nitroId];
|
[self setNitroId:newViewProps.nitroId];
|
||||||
@@ -63,7 +63,7 @@ using namespace facebook::react;
|
|||||||
// Event emitter convenience method
|
// Event emitter convenience method
|
||||||
- (void)onNitroIdChange:(int)nitroId
|
- (void)onNitroIdChange:(int)nitroId
|
||||||
{
|
{
|
||||||
auto eventEmitter = std::dynamic_pointer_cast<const VideoViewEventEmitter>(_eventEmitter);
|
auto eventEmitter = std::dynamic_pointer_cast<const RNCVideoViewEventEmitter>(_eventEmitter);
|
||||||
if (!eventEmitter || nitroId == -1) {
|
if (!eventEmitter || nitroId == -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -78,12 +78,12 @@ using namespace facebook::react;
|
|||||||
|
|
||||||
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
||||||
{
|
{
|
||||||
return concreteComponentDescriptorProvider<VideoViewComponentDescriptor>();
|
return concreteComponentDescriptorProvider<RNCVideoViewComponentDescriptor>();
|
||||||
}
|
}
|
||||||
|
|
||||||
Class<RCTComponentViewProtocol> VideoViewCls(void)
|
Class<RCTComponentViewProtocol> RNCVideoViewCls(void)
|
||||||
{
|
{
|
||||||
return VideoView.class;
|
return RCTVideoViewComponentView.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-3
@@ -2,12 +2,12 @@
|
|||||||
#import <React/RCTUIManager.h>
|
#import <React/RCTUIManager.h>
|
||||||
#import "RCTBridge.h"
|
#import "RCTBridge.h"
|
||||||
|
|
||||||
@interface VideoViewManager : RCTViewManager
|
@interface RCTVideoViewViewManager : RCTViewManager
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation VideoViewManager
|
@implementation RCTVideoViewViewManager
|
||||||
|
|
||||||
RCT_EXPORT_MODULE(VideoView)
|
RCT_EXPORT_MODULE(RNCVideoView)
|
||||||
|
|
||||||
RCT_EXPORT_VIEW_PROPERTY(nitroId, NSNumber)
|
RCT_EXPORT_VIEW_PROPERTY(nitroId, NSNumber)
|
||||||
|
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#import <React/RCTView.h>
|
#import <React/RCTView.h>
|
||||||
|
|
||||||
@interface VideoView : RCTView
|
@interface RCTVideoViewComponentView : RCTView
|
||||||
|
|
||||||
@property (nonatomic, copy) NSNumber *nitroId;
|
@property (nonatomic, copy) NSNumber *nitroId;
|
||||||
@property (nonatomic, copy) RCTDirectEventBlock onNitroIdChange;
|
@property (nonatomic, copy) RCTDirectEventBlock onNitroIdChange;
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
#import "VideoView.h"
|
#import "RCTVideoViewComponentView.h"
|
||||||
|
|
||||||
#import "ReactNativeVideo-Swift-Cxx-Umbrella.hpp"
|
#import "ReactNativeVideo-Swift-Cxx-Umbrella.hpp"
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
#import "ReactNativeVideo-Swift.h"
|
#import "ReactNativeVideo-Swift.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@implementation VideoView {
|
@implementation RCTVideoViewComponentView {
|
||||||
VideoComponentView* _view;
|
VideoComponentView* _view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
_view.translatesAutoresizingMaskIntoConstraints = NO;
|
_view.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
[self addSubview:_view];
|
[self addSubview:_view];
|
||||||
|
|
||||||
// Set up constraints to make VideoComponentView fill NitroView
|
// Set up constraints to make VideoComponentView fill RCTVideoViewComponentView
|
||||||
[NSLayoutConstraint activateConstraints:@[
|
[NSLayoutConstraint activateConstraints:@[
|
||||||
[_view.leadingAnchor constraintEqualToAnchor:self.leadingAnchor],
|
[_view.leadingAnchor constraintEqualToAnchor:self.leadingAnchor],
|
||||||
[_view.trailingAnchor constraintEqualToAnchor:self.trailingAnchor],
|
[_view.trailingAnchor constraintEqualToAnchor:self.trailingAnchor],
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#import <React/RCTViewManager.h>
|
||||||
|
#import "RCTEventDispatcher.h"
|
||||||
|
#import "RCTVideoViewComponentView.h"
|
||||||
|
|
||||||
|
@interface RCTVideoViewViewManager : RCTViewManager
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation RCTVideoViewViewManager
|
||||||
|
|
||||||
|
RCT_EXPORT_MODULE(RNCVideoView)
|
||||||
|
RCT_EXPORT_VIEW_PROPERTY(nitroId, NSNumber)
|
||||||
|
RCT_EXPORT_VIEW_PROPERTY(onNitroIdChange, RCTDirectEventBlock)
|
||||||
|
|
||||||
|
- (UIView *)view {
|
||||||
|
return [[RCTVideoViewComponentView alloc] init];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#import <React/RCTViewManager.h>
|
|
||||||
#import "RCTEventDispatcher.h"
|
|
||||||
#import "VideoView.h"
|
|
||||||
|
|
||||||
@interface ViewViewManager : RCTViewManager
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation ViewViewManager
|
|
||||||
|
|
||||||
RCT_EXPORT_MODULE(VideoView)
|
|
||||||
RCT_EXPORT_VIEW_PROPERTY(nitroId, NSNumber)
|
|
||||||
RCT_EXPORT_VIEW_PROPERTY(onNitroIdChange, RCTDirectEventBlock)
|
|
||||||
|
|
||||||
- (UIView *)view {
|
|
||||||
return [[VideoView alloc] init];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
@@ -135,11 +135,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"codegenConfig": {
|
"codegenConfig": {
|
||||||
"name": "RNVideoViewSpec",
|
"name": "RNCVideoViewSpec",
|
||||||
"type": "all",
|
"type": "components",
|
||||||
"jsSrcsDir": "src/spec/fabric",
|
"jsSrcsDir": "src/spec/fabric",
|
||||||
"android": {
|
"android": {
|
||||||
"javaPackageName": "com.video.react"
|
"javaPackageName": "com.video.react"
|
||||||
|
},
|
||||||
|
"ios": {
|
||||||
|
"componentProvider": {
|
||||||
|
"RNCVideoView": "RCTVideoViewComponentView"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"create-react-native-library": {
|
"create-react-native-library": {
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ module.exports = {
|
|||||||
* @type {import('@react-native-community/cli-types').AndroidDependencyParams}
|
* @type {import('@react-native-community/cli-types').AndroidDependencyParams}
|
||||||
*/
|
*/
|
||||||
android: {
|
android: {
|
||||||
packageImportPath: "import com.video.react.VideoPackage;"
|
packageImportPath: "import com.video.react.VideoPackage;",
|
||||||
|
componentDescriptors: ["RNCVideoViewComponentDescriptor"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -14,4 +14,4 @@ export interface ViewViewNativeProps extends ViewProps {
|
|||||||
onNitroIdChange?: DirectEventHandler<OnNitroIdChangeEvent>;
|
onNitroIdChange?: DirectEventHandler<OnNitroIdChangeEvent>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default codegenNativeComponent<ViewViewNativeProps>('VideoView');
|
export default codegenNativeComponent<ViewViewNativeProps>('RNCVideoView');
|
||||||
|
|||||||
Reference in New Issue
Block a user