A Kel
A Kel

Reputation: 75

Instagram feed that plays videos

I have created an Instagram feed that pulls in images and videos using a hashtag. I know form looking at Instagram on my phone that the videos are being pulled in I done this using JavaScript is it possible to play the videos on my site without opening another window thanks

Update

my JavaScript so far

var feed = new Instafeed({
    clientId: '467ede5a6b9b48ae8e03f4e2582aeeb3',
    limit: 16,
    get: 'tagged',
    tagName: 'teamRousey',
    sortBy: 'most-recent',
    after: function () {
        var images = $("#instafeed").find('a');
        $.each(images, function(index, image) {
            var delay = (index * 75) + 'ms';
            $(image).css('-webkit-animation-delay', delay);
            $(image).css('-moz-animation-delay', delay);
            $(image).css('-ms-animation-delay', delay);
            $(image).css('-o-animation-delay', delay);
            $(image).css('animation-delay', delay);
            $(image).addClass('animated flipInX');
        });
    },
    template: '<video controls ><source src="{{video}}embed/" type="video/mp4"></video>"<div class="likes">&hearts; {{likes}}</div>'
});

feed.run();

Upvotes: 1

Views: 2343

Answers (1)

Endless
Endless

Reputation: 37786

Here we go.

jQuery(function($){

    var feed = new Instafeed({
        clientId: '467ede5a6b9b48ae8e03f4e2582aeeb3',
        limit: 16,
        get: 'tagged',
        tagName: 'teamRousey',
        sortBy: 'most-recent',
        after: function () {
            
        },
        resolution: 'standard_resolution',
        filter: function(image) {
            if (image.type == 'image') {
                image.template = '<img src="' + image.images.standard_resolution.url + '" />';
            } else {
                image.template = '<video width="100%" controls loop><source src="' + image.videos.standard_resolution.url + '" type="video/mp4"/></video>';
            }
            return true;
        },
        template: '<header>{{model.template}}</header><footer><a href="http://instagram.com/{{model.user.username}}">@{{model.user.username}}</a><br>{{caption}}</footer>',

    });

    feed.run();

});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://jsonp.afeld.me/?url=http%3A%2F%2Finstafeedjs.com%2Fjs%2Finstafeed.min.js"></script>
<div id="instafeed"></div>

Upvotes: 8

Related Questions