Last active
August 29, 2015 14:11
-
-
Save poteto/541868bb18be3312c0a6 to your computer and use it in GitHub Desktop.
provider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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