react-native-video/RCTVideoManager.m

43 lines
1.0 KiB
Mathematica
Raw Normal View History

2015-03-30 23:07:55 -06:00
#import "RCTVideoManager.h"
#import "RCTVideo.h"
#import "RCTBridge.h"
#import <AVFoundation/AVFoundation.h>
2015-03-30 23:07:55 -06:00
@implementation RCTVideoManager
@synthesize bridge = _bridge;
- (UIView *)view
{
return [[RCTVideo alloc] initWithEventDispatcher:self.bridge.eventDispatcher];
}
/* Should support: onLoadStart, onLoad, and onError to stay consistent with Image */
- (NSDictionary *)customDirectEventTypes
{
return @{
@"videoLoaded": @{
@"registrationName": @"onLoad"
},
@"videoProgress": @{
@"registrationName": @"onProgress"
},
};
2015-03-30 23:07:55 -06:00
}
RCT_EXPORT_VIEW_PROPERTY(src, NSString);
RCT_EXPORT_VIEW_PROPERTY(resizeMode, NSString);
2015-03-31 00:29:15 -06:00
RCT_EXPORT_VIEW_PROPERTY(repeat, BOOL);
RCT_EXPORT_VIEW_PROPERTY(pause, BOOL);
2015-03-30 23:07:55 -06:00
- (NSDictionary *)constantsToExport
{
return @{@"ScaleNone": AVLayerVideoGravityResizeAspect,
@"ScaleToFill": AVLayerVideoGravityResize,
@"ScaleAspectFit": AVLayerVideoGravityResizeAspect,
@"ScaleAspectFill": AVLayerVideoGravityResizeAspectFill};
2015-03-30 23:07:55 -06:00
}
@end