简体   繁体   English

如何在UITableview中显示视频缩略图?

[英]How to Show Video thumbnails in UITableview?

In my application i get the video link from Sever in UITableview .all these link are store in text file on server.But i want to get the thumbnails of these link in UITableview. 在我的应用程序中,我从UITableview中的Sever获取视频链接。所有这些链接都存储在服务器上的文本文件中。但是我想在UITableview中获取这些链接的缩略图。 here is my image . 这是我的形象。

在此处输入图片说明

As my Screen shot show the link which i fetch from server but NO thumbnails of these link show in red circle. 如我的屏幕快照所示,我从服务器获取的链接显示为红色圆圈,但这些链接的缩略图均未显示。 These red circles are my webviews.here is my code. 这些红色圆圈是我的webviews。这是我的代码。

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CustomCellIdentifier = @"CustomCellIdentifier ";
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier: CustomCellIdentifier];
if (cell == nil)
{
    NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
    cell = [nib objectAtIndex:0];
} 
// Set up the cell.
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, [Listdata objectAtIndex:indexPath.row], cell.webSal.frame.size.width, cell.webSal.frame.size.height];    

cell.lblSal.text = [Listdata objectAtIndex:indexPath.row];
[cell.webSal loadHTMLString:html baseURL:nil];

return cell;
 }

When i use NSlog it show some thing like this. 当我使用NSlog时,它会显示如下内容。

在此处输入图片说明 Any one can Guide me that what mistake i make.Thanx in advance. 任何人都可以指导我我犯了什么错误。

You are testing on simulator. 您正在模拟器上测试。 The thumbnails won't be displayed on simulator. 缩略图不会显示在模拟器上。 You can see the video thumbnail when run in device. 在设备中运行时,您可以看到视频缩略图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM