我想在UIWebView中播放視頻。這個視頻存儲在我的應用程序(這是本地視頻不是來自服務器)。我不想使用MPMoviePlayerController
。iPhone:如何在WebView中播放本地視頻?
我得到了下面的代碼從SO:
NSString *url = @"http://my_url.com/my_movie_path/";
UIWebView* tempAudioPlayer = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
[tempAudioPlayer loadHTMLString:[NSString stringWithFormat:@"<iframe frameborder=\"0\" width=\"0\" height=\"0\" src=\"%@\"></iframe>", url] baseURL:nil];
[self addSubview:tempAudioPlayer];
,但它不是爲我工作。
有沒有其他的方法可以在沒有MPMoviePlayerController
的情況下播放視頻?
我該怎麼辦?
DUPE http://stackoverflow.com/questions/4836595/playing-a-local-video-in-a-uiwebview – box86rowh 2011-12-27 13:20:15
這裏是本地視頻。 – Devang 2011-12-27 13:24:01
另一方面,請嘗試設置uiwebview的基本路徑。 – box86rowh 2011-12-27 13:45:33