Actualmente tengo una vista de tabla con videos de YouTube integrados dentro de las celdas personalizadas.Videos de YouTube dentro de la aplicación UITableView iPhone
Lo hice porque de mi investigación parecía la única forma de permitir que los videos se cargaran sin salir de mi aplicación.
El problema es el siguiente:
Las miniaturas tomar un tiempo para cargar.
Al desplazarme por la lista de videos, sigue teniendo que cargar los thunbnails.
Si me desplazo hacia atrás ... intenta cargar las miniaturas de video una vez más.
¿Alguien ha recibido alguna sugerencia ya sea sobre mejores formas de hacerlo, o formas de obtener las celdas de la tabla para guardar los datos y no reemplazarlos?
Mi código es el siguiente:
CustomVideoCell *cell = (CustomVideoCell *)[tableView dequeueReusableCellWithIdentifier:@"CustomVideoCell"];
if (cell == nil) {
UIViewController *temporaryController = [[UIViewController alloc] initWithNibName:@"CustomVideoCell" bundle:nil];
cell = (CustomVideoCell *)temporaryController.view;
[temporaryController release];
GDataEntryBase *entry = [[self.feed entries] objectAtIndex:indexPath.row];
NSString *title = [[entry title] stringValue];
NSString *videoID = [[(GDataEntryYouTubeVideo *)entry mediaGroup] videoID];
NSString *htmlString =
[
[NSString alloc]
initWithFormat:@"<html><head><meta name = \"viewport\" content = \"initial-scale = 2.0, user-scalable = no, width = 110\"/></head><body style=\"background:#000;margin-top:0px;margin-left:0px\"><div><object width=\"110\" height=\"90\"><param name=\"movie\" value=\"http://www.youtube.com/v/%@&f=gdata_videos&c=ytapi-my-clientID&d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.youtube.com/v/%@&f=gdata_videos&c=ytapi-my-clientID&d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"110\" height=\"90\"></embed></object></div></body></html>",
videoID, videoID
];
[[[cell.web subviews] lastObject] setScrollEnabled:NO];
[cell.web loadHTMLString:htmlString baseURL:[NSURL URLWithString:@"http://www.website.com"]];
cell.title.text = title;
Saludos
¿Alguien sabe de algún buen hilo y/o tutorial porque quiero hacer algo como esto pero realmente no sé por dónde empezar? Lo siento, soy un novato – tallen11