简体   繁体   English

音频无法在iPhone的uiwebview中播放

[英]Audio is not playing in uiwebview in iPhone

i want to play live streaming video in uiwebview it is playing by believe code 我想在uiwebview中播放实时流式视频,通过相信代码进行播放

UIWebView *web=[[UIWebView alloc]initWithFrame:self.view.bounds];
[web loadHTMLString:htmlString baseURL:nil];
NSError *setCategoryErr = nil;
NSError *activationErr  = nil;
web.scalesPageToFit=YES;
web.mediaPlaybackRequiresUserAction=NO;
[self.view addSubview: web];

but the problem is that audio is not playing in simulator or not in any device with that live video what i am doing wrong or what i have missed here 但是问题是音频没有在模拟器中播放,或者没有在带有该实时视频的任何设备中播放,我做错了什么或我在这里错过了什么

go to Info.plist property list - add a new row - select required background modes, there should be a subrow called Item 0, select app plays audio or streams audio/video using AirPlay. 转到Info.plist属性列表-添加新行-选择所需的背景模式,应该有一个名为Item 0的子行,选择应用程序播放音频或使用AirPlay播放音频/视频流。 Also check Audio air play in background modes in compatibility. 还要在兼容的背景模式下检查“音频广播”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM