react-native-video/RCTVideoManager.m

40 lines
936 B
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];
}
/* onLoadStart, onLoad, and onError to stay consistent with Image */
- (NSDictionary *)customDirectEventTypes
{
return @{
@"videoLoaded": @{
@"registrationName": @"onLoad"
},
};
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