Created
September 28, 2017 18:29
-
-
Save elearningplugins/77553452fac8df25a9fcc7167f9d29f2 to your computer and use it in GitHub Desktop.
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
//- (void)playerViewDidBecomeReady:(nonnull YTPlayerView *)playerView{ | |
// NSLog(@"Ready to play"); | |
//[playerView setPlaybackQuality:kYTPlaybackQualitySmall]; | |
// self.playerView.tag = 1; | |
// [self.playerView playVideo]; | |
//} | |
- (void)playerViewDidBecomeReady:(YTPlayerView *)playerView { | |
TMReachability *reachability = [TMReachability reachabilityForInternetConnection]; | |
[reachability startNotifier]; | |
NetworkStatus status = [reachability currentReachabilityStatus]; | |
NSLog(@"Value of status = %ld", (long)status); | |
//NotReachable = 0, | |
//ReachableViaWiFi = 2, | |
//ReachableViaWWAN = 1 | |
if (status == 2) | |
{ | |
//WiFi | |
//testing. loads a single video instead of a playlist. | |
[self.playerView loadVideoById:@"2GkhI6GeD9Q" startSeconds:0.0f suggestedQuality:kYTPlaybackQualitySmall]; | |
} | |
else if (status == 1) | |
{ | |
//3G | |
//testing. loads a single video instead of a playlist. | |
[self.playerView loadVideoById:@"2GkhI6GeD9Q" startSeconds:0.0f suggestedQuality:kYTPlaybackQualitySmall]; | |
} | |
} | |
#pragma mark - Shake Functions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment