Video/audio streaming does not stop even if UIWebView is closed – iPad

I have the same issue as stated but in this case the video that won’t stop playing is a Youtube video embeded using the object/embed method.

I spent a long time trying to figure out how to get the video to stop playing and the only solution I found was to tell the UIWebView to load a blank page before dismissing the view:

    [self.webContent loadRequest:NSURLRequestFromString(@"about:blank")];

Edit(2015-05-12): As mentioned by @chibimai below, this answer by alloc_iNit works along the same lines but since my answer is from 5 years ago — and his only 4 — the linked answer may be more applicable. I no longer do iPhone dev work so I cannot determine which is better either way.

Leave a Comment

tech