Hi guy's I had a thumbnail Image for the video I am playing in the Webview and my code is:
-(void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
printf("\n Inside didSelect method....!!");
masterAisleItemListIndexArray = (NSMutableArray*)[ [masterAisleItemListDictionary allKeys]
sortedArrayUsingSelector:@selector(compare:)];
NSString* sectionName = [masterAisleItemListIndexArray objectAtIndex:indexPath.section];
NSMutableArray* aisleItemsArray = [masterAisleItemListDictionary valueForKey:sectionName];
CustomerDetails *custObj = [aisleItemsArray objectAtIndex:indexPath.row];
printf("\n audiofile = %s",[custObj.audioFile UTF8String]);
webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 320, 400)];
webView.backgroundColor = [UIColor clearColor];
[webView setOpaque:NO];
webView.delegate = self;
[myView addSubview:webView];
webView.backgroundColor = [UIColor blueColor];
[webView loadHTMLString:[self getVideo:custObj.audioFile thumbnail:custObj.thumbnailImage] baseURL:[NSURL URLWithString:@"http:bluepal.com"]];
self.view = myView;
}
I am getting the white screen with play button.I need to get the thumbnail what I had chosen Can it is possible to do this. My html code i am loding into webview is:
-(NSString *)getVideo:(NSString *)aString thumbnail:(NSString *)aThumbnail
{
NSString *htmlString = @"<html><head><meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = no, width = 94\"/></head><body background-image: url(\"";
if([aThumbnail length]>0)
{
htmlString = [htmlString stringByAppendingString:aThumbnail];
htmlString = [htmlString stringByAppendingString:@"\") style=\"background:#000;margin-top:0px;margin-left:0px\"><object width=\"90\" height=\"70\">"];
}
htmlString = [htmlString stringByAppendingString:@"<embed src=\""];
htmlString = [htmlString stringByAppendingString:aString];
htmlString = [htmlString stringByAppendingString:@"\"type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"320\" height=\"400\"></embed>"];
htmlString = [htmlString stringByAppendingString:@"</object>"];
htmlString = [htmlString stringByAppendingString:@"</body></html>"];
printf("\n htmlString.......%s",[htmlString UTF8String]);
return htmlString;
}