Javascript 角形葡萄藤缩略图

Javascript 角形葡萄藤缩略图,javascript,angularjs,vine,Javascript,Angularjs,Vine,我尝试使用以下代码获取其下面的vine缩略图: <!-- language: lang-js --> var onGetVineThumbnailSuccess = function( videoUrl ) { return function( response ) { var args = { videoUrl: videoUrl }; args.thumbnailUrl = response['thumbnail_url']; // jshint igno

我尝试使用以下代码获取其下面的vine缩略图:

<!-- language: lang-js -->
var onGetVineThumbnailSuccess = function( videoUrl ) {
    return function( response ) {
    var args = { videoUrl: videoUrl };
    args.thumbnailUrl = response['thumbnail_url']; // jshint ignore:line

    $rootScope.$broadcast( 'event:onGetVineThumbnailSuccess', args);
  };
};

var getVineThumbnail = function ( videoUrl ) {
  $http
    .get( 'https://vine.co/oembed.json?url=' + encodeURIComponent( videoUrl ) )
    .then( onGetVineThumbnailSuccess( videoUrl ) );
};

听起来像是CORS的问题。但由于我无法控制Vine,我应该如何调用此服务?

访问控制允许源站是在服务器的响应上设置的,而不是在客户端请求时设置的,以允许来自不同源站的客户端访问响应

在您的情况下,不允许您的源站访问响应。因此你无法阅读它

有关CORS的更多信息:

但是,Chrome Webstore有一个扩展,当页面中有异步调用试图访问与您不同的主机时,它会为您添加“Access Control Allow Origin”标题


扩展名是:“Allow Control Allow Origin:*”,这是一个链接:

很好的解释。但这不是解决办法。安装此扩展只能在我的机器上解决此问题。是的!事实上,您无法更改vine服务器上的代码,因此在这里您无法执行任何操作
{
  "version": 1.0,
  "type": "video",
  "cache_age": 3153600000,
  "provider_name": "Vine",
  "provider_url": "https://vine.co/",
  "author_name": "Evengelia",
  "author_url": "https://vine.co/u/1204040590484971520",

  "title": "Everything was beautiful on this day. #6secondsofcalm",

  "thumbnail_url": "https://v.cdn.vine.co/r/videos/59734161E81269170683200901120_45a46e319ea.1.1.8399287741149600271.mp4.jpg?versionId=tc3t.oqGtjpJNlOX1AeM1CAnWONhbRbQ",
  "thumbnail_width": 480,
  "thumbnail_height": 480,
  "html": "<iframe class=\"vine-embed\" src=\"https://vine.co/v/eV1mMuab7Mp/embed/simple\" width=\"600\" height=\"600\" frameborder=\"0\"><\/iframe><script async src=\"//platform.vine.co/static/scripts/embed.js\"><\/script>",
  "width": 600,
  "height": 600
}