Greetings,
I have a tableview where I have parsed an li开发者_运维问答st of podcasts(m4a format). I want to now play the podcasts. I have seen Matt Gallaghers method but it seems a bit excessive for what I need. I remember seeing a tutorial where you could play such a file in UIWebview but it doesn't seems to work. Any suggestions would be greatly appreciated. Thank you in advance.
NSString * basePath = [NSHomeDirectory()
stringByAppendingPathComponent:@"Documents"];
basePath=[basePath stringByReplacingOccurrencesOfString:@"/" withString:@"//"];
basePath=[basePath stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
NSURL * baseURL = [NSURL URLWithString: [NSString
stringWithFormat:@"file:/%@//",basePath]];
NSString *html = @"<html><body><audio src=\"test.mp3\"
controls></audio></body></html>";
[self.view loadHTMLString:html baseURL:baseURL];
I rewrote the code and got this to work, the catch was handling the blanks in the document base path that was causing issue for me.
精彩评论