Skip to content

Instantly share code, notes, and snippets.

@brol1dev
Last active September 13, 2018 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brol1dev/7b840c7a17bcfcbe7fef260f0826cab6 to your computer and use it in GitHub Desktop.
Save brol1dev/7b840c7a17bcfcbe7fef260f0826cab6 to your computer and use it in GitHub Desktop.
[iOS] Shows how to add custom query parameters to the SAS authorization request with the OoyalaPlayer
#import <OoyalaSDK/OoyalaSDK.h>
@interface MyPlayerInfo : OODefaultPlayerInfo
@property (nonatomic) NSDictionary *additionalParams;
@end
@implementation MyPlayerInfo
@synthesize additionalParams;
@end
@interface AdditionalSASQueryParamsVC ()
@property (nonatomic) OOOoyalaPlayerViewController *ooyalaPlayerViewController;
@property (nonatomic) NSString *embedCode;
@property (nonatomic) NSString *pcode;
@property (nonatomic) NSString *playerDomain;
@end
@implementation AdditionalSASQueryParamsVC
- (void)viewDidLoad {
[super viewDidLoad];
MyPlayerInfo *playerInfo = [MyPlayerInfo new];
// Here you add the query params that will be appended to the SAS request
playerInfo.additionalParams = @{@"myKey": @"myValue"};
OOOptions *options = [OOOptions new];
options.playerInfo = playerInfo;
OOOoyalaPlayer *player = [[OOOoyalaPlayer alloc] initWithPcode:self.pcode
domain:[[OOPlayerDomain alloc] initWithString:self.playerDomain] options:options];
self.ooyalaPlayerViewController = [[OOOoyalaPlayerViewController alloc] initWithPlayer:player];
[self addPlayerViewController:self.ooyalaPlayerViewController];
[self.ooyalaPlayerViewController.player setEmbedCode:self.embedCode];
[self.ooyalaPlayerViewController.player play];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment