2015-11-26 59 views
-1

我创建了一个使用标签吸引图片和视频的Instagram资讯提供。我知道,形成我的手机上查看Instagram的是,影片拉进我做到了这一点使用JavaScript是可以播放视频在我的网站,而无需打开另一个窗口感谢播放视频的Instagram资讯提供

更新

我的JavaScript等等远

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(); 
+4

愚蠢的问题值得愚蠢的答案:是的,它可能 – Endless

+1

那么它不是给我一个愚蠢的问题,因为我不知道这就是为什么我问这是很难做到的可以在通过做javascript –

+1

向我们展示你到目前为止得到的结果。 – Endless

回答

2

在这里,我们走吧。

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>

+0

完美谢谢非常多我试着投票你的答案,但我没有足够的代表点,但我很感谢帮助 –

+0

@AKel这很好,但你可以接受我的答案与复选标记? – Endless

+0

是的在那里再次感谢@无尽的 –