An easy way to embed media to your Rails app. Don't worry about messy embedding HTML anymore, just use the media URL.
As of now, it only supports YouTube, Vimeo, Wistia and SoundCloud.
Add this line to your application's Gemfile:
gem 'embed'
And then execute:
$ bundle
Or install it yourself as:
$ gem install embed
On your view
<%= embed("http://www.youtube.com/watch?v=fwncgZ15RVQ") %>
<%= embed('http://www.youtube.com/watch?v=fwncgZ15RVQ', {:width => 540, :height => 290}) %>
Can also specify the protocol («http» by default)
<%= embed('http://www.youtube.com/watch?v=fwncgZ15RVQ', {:width => 540, :height => 290, :protocol => 'https'}) %>
** Soundcloud always uses https ** Wistia does not allow using https
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request