Rootviewcontroller has a webview that plays a youtube video and it has one camera button. User can click on camera button and record video. up to this point its working fine
When I dismiss the camera controller and try to play the video in webview, its frame gets disturbed even though I tried removing and again adding on view.
When I dismiss the camera controller without recording the video its working ok... Here is the image code to play video
GDataEntryBase *entry2 = [[AppDelegate.feed entries] objectAtIndex:[tag intValue]];
NSArray *contents = [[(GDataEntryYouTubeVideo *)entry2 mediaGroup] mediaContents];
NSString *urlString=[NSURL URLWithString:[[contents objectAtIndex:0] URLString]];
NSString *embedHTML = @"\
<html><head>\
<style type=\"text/css\">\
body {\
background-color: black;\
color: black;\
}\
</style>\
</head><body style=\"margin:0\"><div>\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"736\" height=\"571\"></embed></div>\
</body></html>";
NSString *html = [NSString stringWithFormat:embedHTML, urlString, webplay.frame.size .width, webplay.frame.size.height];
NSLog(@"html=%@",html);
[webplay loadHTMLString:html baseURL:nil];
-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
[self dismissModalViewControllerAnimated:YES];
[self viewDidLoad];
// or if u write code in your viewdidapper method than
[self viewDidAppear:NO];
}
you can load your entire view again on cancel button click.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With