0
我已经成功实现了嵌入式vimeo视频到我的应用程序,但是我想创建占位符图像作为覆盖视频,而他们不玩。有没有人有如何做到这一点的想法?如何将占位符图像添加到我的嵌入Vimeo和Youtube视频?
#import "FifthDetailViewController.h"
@interface FifthDetailViewController (Private)
- (void)embedVimeoInWebView:(NSString *)urlString webView: (UIWebView *)aWebView;
@end
@implementation FifthDetailViewController
@synthesize toolbar;
@synthesize videoOne;
#pragma mark -
#pragma mark View lifecycle
- (void) viewDidLoad{
[super viewDidLoad];
[self embedVimeoInWebView:@"http://player.vimeo.com/video/19967404" webView:videoOne];
}
- (void)embedVimeoInWebView:(NSString *)urlString webView:(UIWebView *)aWebView {
NSString *embedHTML = @"\
<html><head>\
<style type=\"text/css\">\
body {\
background-color: transparent;\
color: white;\
}\
</style>\
</head><body style=\"margin:-2\">\
<iframe src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"%0.0f\" height=\"%0.0f\"></iframe>\
</body></html>";
NSString *html = [NSString stringWithFormat:embedHTML, urlString, aWebView.frame.size.width, aWebView.frame.size.height];
//UIWebView *aWebView = [[UIWebView alloc] initWithFrame:frame];
[aWebView loadHTMLString:html baseURL:nil];
//----Disable Scroll UIWebView----
[[[aWebView subviews] lastObject] setScrollEnabled:NO];
//[mainView addSubview:aWebView];
//[self.mainView addSubview:videoView];
[aWebView release];
}
- (void)dealloc {
[toolbar release];
[super dealloc];
}
@end
这是我到目前为止。