discourse/lib/oneboxer/video_onebox.rb
Robin Ward 29519ece23 Merge branch 'add-audio-onebox' of git://github.com/jamesaanderson/discourse into jamesaanderson-add-audio-onebox
Conflicts:
	app/assets/stylesheets/application/compose.css.scss
	app/assets/stylesheets/application/topic-post.css.scss
2013-07-26 11:30:40 -04:00

13 lines
257 B
Ruby

require_dependency 'oneboxer/base_onebox'
module Oneboxer
class VideoOnebox < BaseOnebox
matcher /^https?:\/\/.*\.(mov|mp4)$/
def onebox
"<video controls><source src='#{@url}'><a href='#{@url}'>#{@url}</a></video>"
end
end
end