Skip to content

Instantly share code, notes, and snippets.

@poteto
Last active August 29, 2015 14:11
Show Gist options
  • Save poteto/541868bb18be3312c0a6 to your computer and use it in GitHub Desktop.
Save poteto/541868bb18be3312c0a6 to your computer and use it in GitHub Desktop.
provider
import Ember from 'ember';
export default {
apiUrl: function(videoId) {
return '//vimeo.com/api/oembed.json?url=http%3A//vimeo.com/' + videoId;
},
embedUrl: function(videoId) {
return '//player.vimeo.com/video/' + videoId;
},
thumbnailUrl: function(videoId) {
var apiUrl = this.apiUrl(videoId);
return new Ember.RSVP.Promise(function(resolve) {
Ember.$.getJSON(apiUrl).then(function(res) {
resolve(res.thumbnail_url);
});
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment