I am loading a MP3 file into UIWebView
control on an iPad Application, I have a UIButton
called done the user expected to dismiss the UIWebView
and stop the music, here is a code snippet:
// points to the mp3 file path
NSURL *url = [NSURL fileURLWithPath:self.sFilePath];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[web loadRequest:request];
When the user hit done I do the following:
[self.webview removeFromSuperview];
[self.webview release];
But that does not stop the music from playing, I noticed that loading mp3 files on UIWebView
opens the QuickTime player is that correct way?
I am greatly appreciative of any guidance or help.
Looks like a dupe of Video/audio streaming does not stop even if UIWebView is closed - iPad
The solution there:
[self.webContent loadRequest:NSURLRequestFromString(@"about:blank")];
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