问题
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