iOS:从 UIWebView 中的 URL 加载音频时出现问题
我正在将 MP3 播客流加载到 UIWebView 中,如下所示:
- (void)viewDidLoad
{
[super viewDidLoad];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString:@"http://localhost/podcasts/downloader/download.mp3?af=a&f=10109"]];
[webView loadRequest:request];
}
流似乎正在加载,然后 UIAlert 出现并显示:
An error occurred while exchanging data. "Plug-in handled load"
在流在 QuickTime 中正确加载并播放后立即出现。为什么会出现此警报?
我不想使用 AVAudioPlayer 来播放流,而是使用 QuickTime。
I am loading an MP3 podcast stream into a UIWebView as follows:
- (void)viewDidLoad
{
[super viewDidLoad];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString:@"http://localhost/podcasts/downloader/download.mp3?af=a&f=10109"]];
[webView loadRequest:request];
}
The stream appears to load, and then a UIAlert appears saying:
An error occurred while exchanging data. "Plug-in handled load"
And immediately after the stream loads properly in QuickTime and plays. Why is this alert appearing?
I'd prefer not to use AVAudioPlayer to play the stream, but rather QuickTime.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用的是 iOS,则 URL 指向 localhost,并且设备上可能没有 Web 服务器。
If you are on iOS, the URL is pointing to localhost, and there are probably no web server on the device.
您可以忽略该错误。它是为了让您知道 Quicktime 正在处理负载。
You can just ignore that error. It is to let you know that quicktime is handling the load.