Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSString *embedHTML = @"<html><head><style type="text/css">body {background-color:transparent;color: white;}</style><script>function load({document.getElementById("yt").play();}</script></head><body onload="load()"style="margin:0"><video id="yt" src="%@" width="%0.0f" height="%0.0f" autoplay controls></video></body></html>";
- NSString *html = [NSString stringWithFormat:embedHTML, urlString, videoView.frame.size.width, videoView.frame.size.height,thumbnailImageLink];
- [videoView loadHTMLString:html baseURL:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoPlayStarted:) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoPlayFinished:) name:@"UIMoviePlayerControllerDidExitFullscreenNotification" object:nil];
- BOOL isVideoInFullScreenMode;
- -(void)videoPlayStarted:(NSNotification *)notification{
- //Your stuff here
- isVideoInFullScreenMode = YES;
- }
- -(void)videoPlayFinished:(NSNotification *)notification{
- //Your stuffs here
- isVideoInFullScreenMode = NO;
- }
Add Comment
Please, Sign In to add comment