Guest User

Untitled

a guest
Jan 16th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. 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>";
  2. NSString *html = [NSString stringWithFormat:embedHTML, urlString, videoView.frame.size.width, videoView.frame.size.height,thumbnailImageLink];
  3. [videoView loadHTMLString:html baseURL:nil];
  4.  
  5. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoPlayStarted:) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil];
  6. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoPlayFinished:) name:@"UIMoviePlayerControllerDidExitFullscreenNotification" object:nil];
  7.  
  8. BOOL isVideoInFullScreenMode;
  9. -(void)videoPlayStarted:(NSNotification *)notification{
  10. //Your stuff here
  11. isVideoInFullScreenMode = YES;
  12. }
  13.  
  14. -(void)videoPlayFinished:(NSNotification *)notification{
  15. //Your stuffs here
  16. isVideoInFullScreenMode = NO;
  17. }
Add Comment
Please, Sign In to add comment