oEmbed is a standard for embedding arbitrary content into something else.
Note: Many types of content don't support CORS when using oEmbed, which prevents us from using this client-side-only solution neatly. To get around this, we use publicly-available yahoo proxies, to add the appropriate cors headers.
Install this addon with ember-cli
ember install ember-oembed
Using ember-oembed is as easy as using an <img>
tag.
Using the standard embed content, delivered by the provider
Custom embed content
config/environment.js
var ENV = {
...
oembed: {
providers: {
mysite: {
regex: {
pattern: 'www.mysite.com\/thing',
flags: 'g',
}
providerUrl: 'http://mysite.com/oembed',
defaultParams: {
format: 'json'
}
}
}
}
...
}
This would result in the addon attempting to fetch oEmbed info from
http://mysite.com/oembed?url=http://mysite.com/thing/12345&format=json
git clone
this repositorynpm install
bower install
ember server
- Visit your app at http://localhost:4200.
npm test
(Runsember try:testall
to test your addon against multiple Ember versions)ember test
ember test --server
ember build
For more information on using ember-cli, visit http://ember-cli.com/.