使用 UIWebView 来播放视频

MPMoviePlayerController 并不是继承自 UIViewController

SDK 中的例子使用的是 addSubviews 的方式来添加 MPMoviePlayerController.view

在 UIWebView 中响应事件,然后调用 [MPMoviePlayerController play] 是什么也看不到的。

最方便播放视频的方法是使用 UIWebView 来加载一个 NSURL, 也就是视频的地址。 如:

self.webView = [[[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL URLWithString:string]];
[self.webView loadRequest:request];

转载http://blog.csdn.net/yitailong/article/details/8216868

原文地址:https://www.cnblogs.com/Sucri/p/4996990.html