fccfdbfd30
- Also rename pause to paused - Bump version
46 lines
1.1 KiB
Objective-C
46 lines
1.1 KiB
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] initWithEventDispatcher:self.bridge.eventDispatcher];
|
|
}
|
|
|
|
/* Should support: onLoadStart, onLoad, and onError to stay consistent with Image */
|
|
|
|
- (NSDictionary *)customDirectEventTypes
|
|
{
|
|
return @{
|
|
@"videoLoaded": @{
|
|
@"registrationName": @"onLoad"
|
|
},
|
|
@"videoProgress": @{
|
|
@"registrationName": @"onProgress"
|
|
},
|
|
};
|
|
}
|
|
|
|
RCT_EXPORT_VIEW_PROPERTY(src, NSString);
|
|
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(volume, float);
|
|
RCT_EXPORT_VIEW_PROPERTY(rate, float);
|
|
|
|
- (NSDictionary *)constantsToExport
|
|
{
|
|
return @{@"ScaleNone": AVLayerVideoGravityResizeAspect,
|
|
@"ScaleToFill": AVLayerVideoGravityResize,
|
|
@"ScaleAspectFit": AVLayerVideoGravityResizeAspect,
|
|
@"ScaleAspectFill": AVLayerVideoGravityResizeAspectFill};
|
|
}
|
|
|
|
@end
|