Skip to content

Instantly share code, notes, and snippets.

@brol1dev
Last active April 3, 2017 23:49
Show Gist options
  • Save brol1dev/1b5e4b952f6dd36ab02bd88aa2321082 to your computer and use it in GitHub Desktop.
Save brol1dev/1b5e4b952f6dd36ab02bd88aa2321082 to your computer and use it in GitHub Desktop.
@interface DefaultSkinPlayerViewController ()
@property (nonatomic, retain) OOSkinViewController *skinController;
@property (nonatomic, strong) OOOoyalaPlayer *ooyalaPlayer;
@property NSString *embedCode;
@property NSString *nib;
@property NSString *pcode;
@property NSString *playerDomain;
@end
@implementation DefaultSkinPlayerViewController
// some code
- (void)viewDidLoad {
[super viewDidLoad];
OOOptions *options = [OOOptions new];
self.ooyalaPlayer = [[OOOoyalaPlayer alloc] initWithPcode:self.pcode domain:[[OOPlayerDomain alloc] initWithString:self.playerDomain] options:options];
OODiscoveryOptions *discoveryOptions = [[OODiscoveryOptions alloc] initWithType:OODiscoveryTypePopular limit:10 timeout:60];
NSURL *jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
// NSURL *jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios"];
NSDictionary *overrideConfigs = @{@"upNextScreen": @{@"timeToShow": @"8"}};
self.ooyalaPlayer.actionAtEnd = OOOoyalaPlayerActionAtEndPause; //This is reccomended to make sure the endscreen shows up as expected
// OOSkinOptions *skinOptions = [[OOSkinOptions alloc] initWithDiscoveryOptions:discoveryOptions jsCodeLocation:jsCodeLocation configFileName:@"skin" overrideConfigs:overrideConfigs];
// self.skinController = [[OOSkinViewController alloc] initWithPlayer:ooyalaPlayer skinOptions:skinOptions parent:_videoView launchOptions:nil];
// [self addChildViewController:_skinController];
// [_skinController.view setFrame:self.videoView.bounds];
self.ooyalaPlayer.view.frame = self.videoView.bounds;
[self.videoView addSubview:self.ooyalaPlayer.view];
[[NSNotificationCenter defaultCenter] addObserver: self
selector:@selector(notificationHandler:)
name:nil
object:self.ooyalaPlayer];
if ([self.ooyalaPlayer setEmbedCode:self.embedCode]) {
[self.ooyalaPlayer play];
}
}
// more code
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment