Video player for Youtube, Vimeo, İzlesene and Wistia
Create video player for Youtube, Vimeo, İzlesene and Wistia videos for Ruby.
And it may support more video hoster with your contributions.
Installation
Add it to your Gemfile:
gem 'video_player'
and run on terminal:
$ bundle
or install the gem on terminal.
$ gem install video_player
Parameters
url
Youtube, Vimeo, İzlesene and Wistia video link
http://www.youtube.com/watch?v=iEPTlhBmwRg
or
http://vimeo.com/101419884
or
http://www.izlesene.com/video/feder-goodbye-feat-lyse/7886121
or
https://.wistia.com/medias/9ub91enoph
width (default = 420)
height (default = 315)
autoplay (default = true) - works only on Youtube
Usage
require 'video_player'
VideoPlayer::player("http://vimeo.com/101419884")
VideoPlayer::player("http://www.youtube.com/watch?v=iEPTlhBmwRg", "1200", "800", true)
VideoPlayer::player("http://www.izlesene.com/video/feder-goodbye-feat-lyse/7886121")
VideoPlayer::player("https://example.wistia.com/medias/9ub91enoph")
It gets you only raw data. You must handle it on erb, haml, slim, etc for output without HTML escaping.
video = VideoPlayer::player("http://vimeo.com/101419884")
<%= video.html_safe %>
= video.html_safe
== video
Contributing
- Fork it ( https://github.com/tgezginis/video_player/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Extend the specs, run with
rake
- Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Thanks
mikel
foxgaocn