Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

187
Vistas
Instafeed JS show both images and videos

I am trying to change the template depending if its a image or video but it doesnt seem to work, it just uses the template provided when calling the function

<script src="https://cdn.jsdelivr.net/gh/stevenschobert/instafeed.js@2.0.0rc1/src/instafeed.min.js"></script>
<div class="instagram-module" id="instafeed"></div>

<script type="text/javascript">
    var feed = new Instafeed({
        get: 'user',
        target: 'instafeed',
        limit: 10,
        template: '<a class="instagram-link" href="{{link}}" target="_blank" rel="noopener"><figure class="instagram-figure"><video controls loop><source src="' + image.model.media_url + '" type="video/mp4"/></video><figcaption class="instagram-caption" >{{caption}}</figcaption></figure></a>',
        resolution: 'low_resolution',
        accessToken: 'token',
        filter: function(image) {

            if (image.type == 'image' ) {
                image.template = '<img src="' + image.image + '" />';
            } else {
          
                image.template = '<video controls loop><source src="' + image.model.media_url + '" type="video/mp4"/></video>';
            }
            return true;
        }
    });
    feed.run();
</script>
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda