Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ipad camera and webview youtube video playing issue

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 imageenter image description here 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];
like image 808
GameLoading Avatar asked Sep 19 '11 05:09

GameLoading


1 Answers

-(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.

like image 144
freelancer Avatar answered Oct 20 '22 21:10

freelancer