Last active
September 13, 2018 19:04
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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