Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/10/2019, 09:41
Avatar de ceaped
ceaped
 
Fecha de Ingreso: febrero-2004
Mensajes: 2.185
Antigüedad: 20 años, 2 meses
Puntos: 9
Respuesta: Galería swipebox no me funciona con YouTube ni en local

Hola de nuevo
Sigo intentando que me cargue en local videos con formato mp4 pero no me funciona.
Yo sigo las instrucciones que da "carlosjosedesign" pero no me funciona. Así lo puse:

Código Javascript:
Ver original
  1. isVideo : function (src){
  2.  
  3.                 if( src ){
  4.                     if(
  5.                         src.match(/youtube\.com\/watch\?v=([a-zA-Z0-9\-_]+)/)
  6.                         || src.match(/vimeo\.com\/([0-9]*)/)
  7.                         || src.match('://(www.)?dailymotion\.com')
  8.                         || src.match(/mp4|wmv|wma|ogv|ogg|flv/)
  9.                     ){
  10.                         return true;
  11.                     }
  12.                 }
  13.  
  14.             },

Agregué esta linea:

Código Javascript:
Ver original
  1. src.match(/mp4|wmv|wma|ogv|ogg|flv/)

Código Javascript:
Ver original
  1. getVideo : function(url){
  2.                
  3. var normalvideoUrl=url.match(/uploads\/([a-zA-Z0-9\-_/.*]+)/)
  4.                
  5.                 var success = false;
  6.                 if (url.match('://(www.)?youtube|youtu\.be')) {
  7.                     if (url.match('embed')) { youtube_id = url.split(/embed\//)[1].split('"')[0]; }
  8.                     else { youtube_id = url.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0]; }
  9.                     v_id    = youtube_id;
  10.                     i_src = "http://www.youtube.com/embed/"+v_id+"?controls=1&color=white&showinfo=0&autoplay=1&hd=1&fs=1&rel=0";
  11.                     success = true;
  12.                 }
  13.                 else if (url.match('://(player.)?vimeo\.com')) {
  14.                     vimeo_Reg = /https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/;
  15.                     match = url.match(vimeo_Reg);
  16.                     v_id = match[3];
  17.                     i_src = "http://player.vimeo.com/video/"+v_id+"?title=0&byline=0&portrait=0&color=ffffff&autoplay=1";
  18.                     success = true;
  19.                 }
  20.                 else if (url.match('://(www.)?dailymotion\.com')) {
  21.                     m = url.match(/^.+dailymotion.com\/((video|hub)\/([^_]+))?[^#]*(#video=([^_&]+))?/);
  22.                     v_id = m ? m[5] || m[3] : null;
  23.                     i_src = "http://www.dailymotion.com/embed/video/"+v_id+"?autoplay=true&background=000000&foreground=ffffff&highlight=ffffff";
  24.                     success = true;
  25.                 }
  26.                 else if(normalvideoUrl){  iframe= '<video class="wp-video-shortcode" width="560" height="315" preload="metadata" autoplay="autoplay" controls="controls"><source type="video/mp4" src="/wp-content/uploads/'+normalvideoUrl[1]+'"></video>'}
  27.                 }
  28.                 if (success) {
  29.                     iframe = '<iframe width="560" height="315"  src="'+i_src+'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
  30.                     return '<div class="swipebox-video-container" style="max-width:'+plugin.settings.videomaxWidth+'px"><div class="swipebox-video">'+iframe+'</div></div>';}
  31.                 },

Y acá estas dons nuevas líneas:

Código Javascript:
Ver original
  1. var normalvideoUrl=url.match(/uploads\/([a-zA-Z0-9\-_/.*]+)/)

Código Javascript:
Ver original
  1. else if(normalvideoUrl){  iframe= '<video class="wp-video-shortcode" width="560" height="315" preload="metadata" autoplay="autoplay" controls="controls"><source type="video/mp4" src="/wp-content/uploads/'+normalvideoUrl[1]+'"></video>'}

Pero no me funciona los videos en local mp4

¿Cómo debo hacer para que me funcione?

Gracias por su ayuda
__________________
Diseñador Gráfico publicitario