iPhone UIWebview视频播放4.0 [英] iPhone UIWebview video playback 4.0

查看:111
本文介绍了iPhone UIWebview视频播放4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在4.0是公开的,我可以编辑这个问题并再次询问。
此代码适用于3.2和任何以前的版本,但在4.0中我得到一个alertView说这部电影无法播放。

Now that 4.0 is public, I can edit this question and ask it again. This code works in 3.2 and any prior versions, but in 4.0 I get an alertView saying "This movie could not be played".

ivar webView

ivar webView

//in viewDidLoad
self.webView =  [[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];

webView.scalesPageToFit = YES;
webView.delegate = self;

// in tableView didSelectRowAtIndexPath

// url contains a video from web 
NSURL *url = [NSURL URLWithString:@"http://www.somevalid.td/validmovie.mp4"];
[webView loadRequest:[NSURLRequest requestWithURL:url]];

在日志中显示设置电影路径(null)

In the log it says "setting movie path (null)"

推荐答案

我刚测试了你的代码,它在模拟器和开发iPhone 3GS上运行良好。它可能是电影文件本身(可能是iPhone的分辨率太高?)或服务器的某些东西。

I just tested your code and it works fine on both simulator and on a development iPhone 3GS. Could it be something with the movie file itself (maybe too high resolution for iPhone?) or something with the server.

尝试将NSURL下载到设备上的文件中,然后使用管理器将其复制到您的计算机和iTunes中,将其复制回来,看它是否播放。如果没有,你知道问题在于电影文件本身。

Try to download the NSURL to a file on your device, then use Organizer to copy it to your computer and in iTunes, copy it back and see if it plays. If not, you know that the problem lies with the movie file itself.

这篇关于iPhone UIWebview视频播放4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆