Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop video in UIWebView

In my iPad App I have a modal view (UIViewController with modal presentation style UIModalPresentationPageSheet)

Inside the view is a UIWebView with a HTML page and an embedded YouTube-Video. If I start the video and close the view, the video doesn't stop. The audio continues and you can see a small "play icon" next to the "battery icon" in the status bar.

How can I stop the video?

like image 817
Manni Avatar asked Aug 12 '11 09:08

Manni


1 Answers

Do integrate following code to sort out the problem.

    -(void)viewWillDisappear:(BOOL)animated
    {
        [webView loadHTMLString:nil baseURL:nil];
    }
like image 150
alloc_iNit Avatar answered Oct 12 '22 22:10

alloc_iNit