react-native-video/RCTVideoManager.m
Brent Vatne e504944ef5 Swap out MPMoviePlayerController for AVPlayer
- Better performance, can play multiple videos on one screen too!
2015-04-04 17:55:37 -07:00

27 lines
649 B
Objective-C

#import "RCTVideoManager.h"
#import "RCTVideo.h"
#import "RCTBridge.h"
#import <AVFoundation/AVFoundation.h>
@implementation RCTVideoManager
@synthesize bridge = _bridge;
- (UIView *)view
{
return [[RCTVideo alloc] init];
}
RCT_EXPORT_VIEW_PROPERTY(src, NSString);
RCT_EXPORT_VIEW_PROPERTY(resizeMode, NSString);
RCT_EXPORT_VIEW_PROPERTY(repeat, BOOL);
- (NSDictionary *)constantsToExport
{
return @{@"ScaleNone": AVLayerVideoGravityResizeAspect,
@"ScaleToFill": AVLayerVideoGravityResize,
@"ScaleAspectFit": AVLayerVideoGravityResizeAspect,
@"ScaleAspectFill": AVLayerVideoGravityResizeAspectFill};
}
@end