gpt4 book ai didi

iphone - 使用 ffmpeg 在 iPhone 上进行 FLV 流传输

转载 作者:行者123 更新时间:2023-12-03 21:21:29 24 4
gpt4 key购买 nike

早上好,我是一名 iOS/Mac 开发人员。

我正在开发一个从网站获取 flv 链接的应用程序:现在我想在流媒体中播放此 flv 文件。

我在AppStore BUZZPlayer中找到了一个可以播放flv视频流的应用程序:http://itunes.apple.com/it/app/buzz-player/id389744738?mt=8

在 Google 上搜索我发现存在适用于 iPhone 的 ffmpeg,所以我的问题是如何在 iPhone 上使用 ffmpeg 流式传输 FLV 视频?

非常感谢示例代码!

谢谢。

附注抱歉我的英语不好......

最佳答案

我推荐的解决方案是显示一种 Web View ,然后将视频嵌入 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];
}

希望这对您有所帮助。

关于iphone - 使用 ffmpeg 在 iPhone 上进行 FLV 流传输,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4177239/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com