Skip to content

Instantly share code, notes, and snippets.

@elearningplugins
Created September 28, 2017 18:29
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 elearningplugins/77553452fac8df25a9fcc7167f9d29f2 to your computer and use it in GitHub Desktop.
Save elearningplugins/77553452fac8df25a9fcc7167f9d29f2 to your computer and use it in GitHub Desktop.
//- (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