Skip to content

Instantly share code, notes, and snippets.

@fra3il fra3il/0.m Secret
Last active Feb 2, 2016

Embed
What would you like to do?
[WP/171] YouTube 동영상의 재생, 종료 시점을 확인하는 방법
- (void)viewDidLoad {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeStarted:) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeFinished:) name:@"UIMoviePlayerControllerDidExitFullscreenNotification" object:nil];
}
- (void)youTubeStarted:(NSNotification *)notification {
NSLog(@"youTubeStarted");
}
- (void)youTubeFinished:(NSNotification *)notification {
NSLog(@"youTubeFinished");
}
// iOS4.3 이상
UIMoviePlayerControllerDidEnterFullscreenNotification
UIMoviePlayerControllerDidExitFullscreenNotification
// iOS4.2 이하
UIMoviePlayerControllerDidEnterFullcreenNotification
UIMoviePlayerControllerDidExitFullcreenNotification
// YouTube
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_3
#define UIMoviePlayerControllerDidEnterFullscreenNotification @"UIMoviePlayerControllerDidEnterFullscreenNotification"
#define UIMoviePlayerControllerDidExitFullscreenNotification @"UIMoviePlayerControllerDidExitFullscreenNotification"
#else
#define UIMoviePlayerControllerDidEnterFullscreenNotification @"UIMoviePlayerControllerDidEnterFullcreenNotification"
#define UIMoviePlayerControllerDidExitFullscreenNotification @"UIMoviePlayerControllerDidExitFullcreenNotification"
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.