2010-11-14 103 views
2

早上好, 我是iOS/Mac開發人員。使用ffmpeg在iPhone上進行FLV流式傳輸

我正在開發一個應用程序,從一個網站抓取FLV鏈接:現在我想播放流FLV文件。

我在AppStore上BUZZPlayer發現,一個應用程序,它可以播放FLV視頻流:http://itunes.apple.com/it/app/buzz-player/id389744738?mt=8

搜索在谷歌我找出存在的ffmpeg的iPhone,因此,我的問題是我怎麼可以串流播放FLV視頻的有關ffmpeg在iPhone上?

示例代碼非常感謝!

謝謝。

P.S.對不起,我可憐的英語......

+0

你長了解決辦法了嗎? – 2013-04-16 19:05:32

+0

不好:(一年前我或多或少地退出了它。 – Sylter 2013-04-19 16:46:02

回答

1

我推薦的解決方案是顯示一種網頁視圖,然後把視頻嵌入到HTML中。

就像用你的flv鏈接生成一些html代碼一樣。

這是我正在談論的一個例子。

- (void)embedYouTube:(NSString*)url frame:(CGRect)frame { 
NSString* embedHTML = @"\ 
    <html><head>\ 
<style type=\"text/css\">\ 
body {\ 
background-color: transparent;\ 
color: white;\ 
}\ 
</style>\ 
</head><body style=\"margin:0\">\ 
    <embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \ 
width=\"%0.0f\" height=\"%0.0f\"></embed>\ 
    </body></html>"; 
NSString* html = [NSString stringWithFormat:embedHTML, url, frame.size.width, frame.size.height]; 
if(videoView == nil) { 
    videoView = [[UIWebView alloc] initWithFrame:frame]; 
    [self.view addSubview:videoView]; 
} 
[videoView loadHTMLString:html baseURL:nil]; 
} 

希望這有助於任何方式。