Clean project structure (#320)
This commit is contained in:
committed by
Matt Apperson
parent
8c9168b582
commit
0c746e8fe8
68
ios/RCTVideoManager.m
Normal file
68
ios/RCTVideoManager.m
Normal file
@@ -0,0 +1,68 @@
|
||||
#import "RCTVideoManager.h"
|
||||
#import "RCTVideo.h"
|
||||
#import "RCTBridge.h"
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
|
||||
@implementation RCTVideoManager
|
||||
|
||||
RCT_EXPORT_MODULE();
|
||||
|
||||
@synthesize bridge = _bridge;
|
||||
|
||||
- (UIView *)view
|
||||
{
|
||||
return [[RCTVideo alloc] initWithEventDispatcher:self.bridge.eventDispatcher];
|
||||
}
|
||||
|
||||
/* Should support: onLoadStart, onLoad, and onError to stay consistent with Image */
|
||||
|
||||
- (NSArray *)customDirectEventTypes
|
||||
{
|
||||
return @[
|
||||
@"onVideoLoadStart",
|
||||
@"onVideoLoad",
|
||||
@"onVideoError",
|
||||
@"onVideoProgress",
|
||||
@"onVideoSeek",
|
||||
@"onVideoEnd",
|
||||
@"onVideoFullscreenPlayerWillPresent",
|
||||
@"onVideoFullscreenPlayerDidPresent",
|
||||
@"onVideoFullscreenPlayerWillDismiss",
|
||||
@"onVideoFullscreenPlayerDidDismiss",
|
||||
@"onReadyForDisplay",
|
||||
@"onPlaybackStalled",
|
||||
@"onPlaybackResume",
|
||||
@"onPlaybackRateChange"
|
||||
];
|
||||
}
|
||||
|
||||
- (dispatch_queue_t)methodQueue
|
||||
{
|
||||
return dispatch_get_main_queue();
|
||||
}
|
||||
|
||||
RCT_EXPORT_VIEW_PROPERTY(src, NSDictionary);
|
||||
RCT_EXPORT_VIEW_PROPERTY(resizeMode, NSString);
|
||||
RCT_EXPORT_VIEW_PROPERTY(repeat, BOOL);
|
||||
RCT_EXPORT_VIEW_PROPERTY(paused, BOOL);
|
||||
RCT_EXPORT_VIEW_PROPERTY(muted, BOOL);
|
||||
RCT_EXPORT_VIEW_PROPERTY(controls, BOOL);
|
||||
RCT_EXPORT_VIEW_PROPERTY(volume, float);
|
||||
RCT_EXPORT_VIEW_PROPERTY(playInBackground, BOOL);
|
||||
RCT_EXPORT_VIEW_PROPERTY(playWhenInactive, BOOL);
|
||||
RCT_EXPORT_VIEW_PROPERTY(rate, float);
|
||||
RCT_EXPORT_VIEW_PROPERTY(seek, float);
|
||||
RCT_EXPORT_VIEW_PROPERTY(currentTime, float);
|
||||
RCT_EXPORT_VIEW_PROPERTY(fullscreen, BOOL);
|
||||
|
||||
- (NSDictionary *)constantsToExport
|
||||
{
|
||||
return @{
|
||||
@"ScaleNone": AVLayerVideoGravityResizeAspect,
|
||||
@"ScaleToFill": AVLayerVideoGravityResize,
|
||||
@"ScaleAspectFit": AVLayerVideoGravityResizeAspect,
|
||||
@"ScaleAspectFill": AVLayerVideoGravityResizeAspectFill
|
||||
};
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user