Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

192
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!