2015-11-26 61 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

是的在那裏再次感謝@無盡的 –