//
//  RCTOMPlayerManager.m
//  OMPlayer
//
//  Created by lcg on 2017/1/20.
//  Copyright © 2017年 Anren. All rights reserved.
//

#import "RCTOMPlayerManager.h"
#import "RCTOMPlayerView.h"

@implementation RCTOMPlayerManager

RCT_EXPORT_MODULE()

@synthesize bridge = _bridge;

- (instancetype)init
{
    if ((self = [super init])) {

    }
    
    return self;
}

- (UIView *)view
{
    return [[RCTOMPlayerView alloc] init];
}


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(controls, BOOL);
RCT_EXPORT_VIEW_PROPERTY(volume, float);
RCT_EXPORT_VIEW_PROPERTY(rate, float);
RCT_EXPORT_VIEW_PROPERTY(seek, float);
RCT_EXPORT_VIEW_PROPERTY(currentTime, float);
RCT_EXPORT_VIEW_PROPERTY(fullscreen, BOOL);

RCT_EXPORT_VIEW_PROPERTY(onOMVideoLoadStart, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onOMVideoLoad, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onOMVideoError, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onOMVideoProgress, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onOMVideoSeek, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onOMVideoEnd, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onOMVideoFullscreenPlayerWillPresent, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onOMVideoFullscreenPlayerDidPresent, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onOMVideoFullscreenPlayerWillDismiss, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onOMVideoFullscreenPlayerDidDismiss, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onOMReadyForDisplay, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onOMPlaybackStalled, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onOMPlaybackResume, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onOMPlaybackRateChange, RCTBubblingEventBlock);

@end
