Ver Mensaje Individual
  #4 (permalink)  
Antiguo 20/07/2010, 05:42
elxus
 
Fecha de Ingreso: julio-2010
Ubicación: Zaragoza
Mensajes: 6
Antigüedad: 13 años, 9 meses
Puntos: 0
Respuesta: Galeria de Videos ASP YouTuBe

Cita:
Iniciado por Mexman Ver Mensaje
Y por ultimo el archivo javascript que lo he modificado. cambiando etiquetas html.

Nota: También aquí he tenido que cambiar las 3 w y el protocolo por asteriscos.


Código javascript:
Ver original
  1. //-------------------------------------------------
  2. //      youtube playlist jquery plugin
  3. //      Created by [email protected]
  4. //      ***.geckonewmedia.com
  5. //-------------------------------------------------
  6.  
  7. jQuery.fn.ytplaylist = function(options) {
  8.  
  9.    // default settings
  10.   var options = jQuery.extend( {
  11.     holderId: 'video',
  12.     playerHeight: '400',
  13.     playerWidth: '500',
  14.     addThumbs: false,
  15.     thumbSize: 'small',
  16.     showInline: false,
  17.     autoPlay: true,
  18.     showRelated: false // true
  19.   },options);
  20.  
  21.   return this.each(function() {
  22.                            
  23.         var selector = $(this);
  24.        
  25.         var autoPlay = "";
  26.         var showRelated = "&rel=0";
  27.         if(options.autoPlay) autoPlay = "&autoplay=1";
  28.         if(options.showRelated) showRelated = "&rel=0";
  29.        
  30.         //throw a youtube player in
  31.         function play(id)
  32.         {
  33.            var html  = '';
  34.            
  35.            html += '<object height="'+options.playerHeight+'" width="'+options.playerWidth+'">';
  36.            html += '<param name="movie" value="****://***.youtube.com/v/'+id+autoPlay+showRelated+'"></param>';
  37.            html += '<param name="wmode" value="transparent"></param>';
  38.            html += '<embed src="****://***.youtube.com/v/'+id+autoPlay+showRelated+'" type="application/x-shockwave-flash" wmode="transparent"  height="'+options.playerHeight+'" width="'+options.playerWidth+'"></embed>';
  39.            html += '</object>';
  40.    
  41.            return html;
  42.         };
  43.        
  44.         //grab a youtube id from a (clean, no querystring)
  45.         function youtubeid(url) {
  46.             var ytid = url.match("[\\?&]v=([^&#]*)");
  47.             ytid = ytid[1];
  48.             return ytid;
  49.         };
  50.        
  51.        
  52.         //load inital video
  53.         var firstVid = selector.children("p:first-child").addClass("currentvideo").children("a").attr("href");
  54.         $("#"+options.holderId+"").html(play(youtubeid(firstVid)));
  55.        
  56.         //load video on request
  57.         selector.children("p").children("a").click(function() {
  58.            
  59.             if(options.showInline) {
  60.                 $("div.currentvideo").removeClass("currentvideo");
  61.                 $(this).parent("div").addClass("currentvideo").html(play(youtubeid($(this).attr("href"))));
  62.             }
  63.             else {
  64.                 $("#"+options.holderId+"").html(play(youtubeid($(this).attr("href"))));
  65.                 $(this).parent().parent("div").find("div.currentvideo").removeClass("currentvideo");
  66.                 $(this).parent("div").addClass("currentvideo");
  67.             }
  68.                                                              
  69.            
  70.            
  71.             return false;
  72.         });
  73.        
  74.         // jQuery Youtube plugin - jYouTube
  75.         if(options.addThumbs) {
  76.            
  77.             selector.children().each(function(i){
  78.                                              
  79.                 var replacedText = $(this).text();
  80.                
  81.                 if(options.thumbSize == 'small') {
  82.                     var thumbUrl = "****://img.youtube.com/vi/"+youtubeid($(this).children("a").attr("href"))+"/2.jpg";
  83.                 }
  84.                 else {
  85.                     var thumbUrl = "****://img.youtube.com/vi/"+youtubeid($(this).children("a").attr("href"))+"/0.jpg";
  86.                 }
  87.                
  88.                
  89.                 $(this).children("a").empty().html("<img src='"+thumbUrl+"' alt='"+replacedText+"' />"+replacedText).attr("title", replacedText);
  90.                
  91.             });
  92.            
  93.         }
  94.            
  95.        
  96.    
  97.   });
  98.  
  99. };
Lo primero que tienes que hacer el poner entre comillas todos los rs.fields que sacas de la DD.BB. Es decir:
RS.Fields("v_describe") o RS.Fields("lo_que_sea")