In one of my application i have to play video in UITableviewcell, at a time in one cell one video will play and when scroll UITableview and cell hide video should stop. My project is in Objc.
any suggestion for any third party?
thanks in advance
In one of my application i have to play video in UITableviewcell, at a time in one cell one video will play and when scroll UITableview and cell hide video should stop. My project is in Objc.
any suggestion for any third party?
thanks in advance
Use UIWebView in that cell, it will work fine
NSString *baseUrl = @"http://www.youtube.com/embed/";
NSString *videoUrl = [NSString stringWithFormat:@"%@%@",baseUrl,embedCode];
videoUrl = [videoUrl stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
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,videoUrl, 300.0, 200.0];
UIWebView *videoWebView = [[UIWebView alloc] initWithFrame:CGRectMake(8, 10.0, width-16, (width-16)/1.8)];
[videoWebView setAllowsInlineMediaPlayback:YES];
videoWebView.mediaPlaybackRequiresUserAction = YES;
videoWebView.scrollView.scrollEnabled = NO;
videoWebView.scrollView.bounces = NO;
[videoWebView loadHTMLString:html baseURL:nil];
[self.contentView addSubview:videoWebView];