video embedded on a link not working on UIWebview with iOS6 simulator or device

岁酱吖の 提交于 2019-12-11 19:15:01

问题


does iOS 6 webview have an issue of presenting videos ? :(

my code is a simple call to webview's loadRequest method:

 self.webview.scalesPageToFit = YES;
[self.webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.youtube.com/watch?v=3WEpUAQ7fa8"]]];

cosole says:

[MPAVController] Autoplay: Enabling autoplay
[MPAVController] Autoplay: Disabling autoplay for pause
[MPAVController] Autoplay: Disabling autoplay
[MPAVController] Autoplay: Ending background task assertion (8) for playback stall
[MPAVController] Autoplay: _streamLikelyToKeepUp: 0 -> 1
[MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 1, on player: 1)

I referred to this answer but in vain.

please suggest an answer.


回答1:


Hi since you cannot use MPMoviePlayerController, you have to use Webview, instead of using

self.webview.scalesPageToFit = YES;
[self.webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.youtube.com/watch?v=3WEpUAQ7fa8"]]];

Try this way to embed,



来源:https://stackoverflow.com/questions/14154137/video-embedded-on-a-link-not-working-on-uiwebview-with-ios6-simulator-or-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!