【问题标题】:FLV Streaming on iPhone with ffmpeg使用 ffmpeg 在 iPhone 上流式传输 FLV
【发布时间】:2024-01-13 20:17:01
【问题描述】:
【问题讨论】:
标签:
iphone
objective-c
ios4
ffmpeg
【解决方案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];
}
希望这对您有所帮助。