This file contains hidden or 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
- (void)printQualityLevel | |
{ | |
NSLog(@"current playback quality:- "); | |
switch (self.mYTPlayerView.playbackQuality) { | |
case kYTPlaybackQualitySmall: | |
NSLog(@"kYTPlaybackQualitySmall"); | |
break; | |
case kYTPlaybackQualityMedium: | |
NSLog(@"kYTPlaybackQualityMedium"); | |
break; |
This file contains hidden or 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
#pragma --- | |
#pragma YTPlayerView Delegates | |
- (void)playerViewDidBecomeReady:(YTPlayerView *)playerView | |
{ | |
NSLog(@"YTPlayerView : playerViewDidBecomeReady"); | |
NSArray *qualityLevels = [self.mYTPlayerView availableQualityLevels]; | |
NSLog(@"quality levels available:- %@", qualityLevels); | |
} |
This file contains hidden or 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
- (IBAction)pause:(id)sender | |
{ | |
if(self.mYTPlayerView.playerState == kYTPlayerStatePlaying){ | |
[self.mYTPlayerView pauseVideo]; | |
} | |
} | |
- (IBAction)stop:(id)sender | |
{ | |
if(self.mYTPlayerView.playerState == kYTPlayerStatePlaying || self.mYTPlayerView.playerState == kYTPlayerStatePaused){ |
This file contains hidden or 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
- (IBAction)play:(id)sender | |
{ | |
if(self.mYTPlayerView.playerState != kYTPlayerStatePlaying){ | |
[self.mYTPlayerView playVideo]; | |
} | |
} |
This file contains hidden or 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
NSDictionary *playerVars = @{@"playsinline" : @1,}; | |
if([self.mYTPlayerView loadWithVideoId:@"M7lc1UVf-VE" playerVars:playerVars]) | |
{ | |
self.mYTPlayerView.delegate = self; | |
} | |
else | |
{ | |
NSLog(@"failed loading player"); | |
} |
This file contains hidden or 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
- (void)showActionSheetWithTwoButtons { | |
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:@"ActionSheet!" | |
message:@"This is an ActionSheet." | |
preferredStyle:UIAlertControllerStyleActionSheet]; | |
[alertView addAction:[UIAlertAction actionWithTitle:@"ok" | |
style:UIAlertActionStyleDefault | |
handler:^(UIAlertAction *action) { | |
NSLog(@"action - %@", action.title); |
This file contains hidden or 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
- (void)showAlertWithTwoTextField { | |
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:@"Menu" | |
message:@"Select a menu" | |
preferredStyle:UIAlertControllerStyleAlert]; | |
[alertView addTextFieldWithConfigurationHandler:^(UITextField *textField) { | |
textField.placeholder = @"User name"; | |
textField.textColor = [UIColor whiteColor]; |
This file contains hidden or 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
- (void)showAlertWithTextField { | |
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:@"Menu" | |
message:@"Select a menu" | |
preferredStyle:UIAlertControllerStyleAlert]; | |
[alertView addTextFieldWithConfigurationHandler:^(UITextField *textField) { | |
//Customize the textField | |
textField.placeholder = @"User name"; | |
textField.textColor = [UIColor whiteColor]; |
This file contains hidden or 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
- (void)showAlertWithTwoButtons { | |
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:@"Alert!" | |
message:@"This is an Alert." | |
preferredStyle:UIAlertControllerStyleAlert]; | |
[alertView addAction:[UIAlertAction actionWithTitle:@"ok" | |
style:UIAlertActionStyleDefault | |
handler:^(UIAlertAction *action) { | |
NSLog(@"action - %@", action.title); |
This file contains hidden or 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
- (void)showSimpleAlert { | |
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:@"Alert!" | |
message:@"This is an Alert." | |
preferredStyle:UIAlertControllerStyleAlert]; | |
[alertView addAction:[UIAlertAction actionWithTitle:@"ok" | |
style:UIAlertActionStyleDefault | |
handler:^(UIAlertAction *action) { | |
NSLog(@"action - %@", action.title); |