mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 22:08:41 +08:00
Allow Youtube onebox with start time. All params are used in the youtube onebox now.
This commit is contained in:
parent
4a0b17bb16
commit
acca220380
@ -18,8 +18,6 @@ module Oneboxer
|
||||
Entry.new(/^https?:\/\/(?:www\.)?cnn\.com\/.+/),
|
||||
Entry.new(/^https?:\/\/(?:www\.)?washingtonpost\.com\/.+/),
|
||||
Entry.new(/^https?:\/\/(?:www\.)?funnyordie\.com\/.+/),
|
||||
Entry.new(/^https?:\/\/(?:www\.)?youtube\.com\/.+/),
|
||||
Entry.new(/^https?:\/\/(?:www\.)?youtu\.be\/.+/),
|
||||
Entry.new(/^https?:\/\/(?:www\.)?500px\.com\/.+/),
|
||||
Entry.new(/^https?:\/\/(?:www\.)?scribd\.com\/.+/),
|
||||
Entry.new(/^https?:\/\/(?:www\.)?photobucket\.com\/.+/),
|
||||
|
10
lib/oneboxer/youtube_onebox.rb
Normal file
10
lib/oneboxer/youtube_onebox.rb
Normal file
@ -0,0 +1,10 @@
|
||||
require_dependency 'oneboxer/oembed_onebox'
|
||||
|
||||
module Oneboxer
|
||||
class YoutubeOnebox < OembedOnebox
|
||||
matcher /^https?:\/\/(?:www\.)?(?:youtube\.com|youtu\.be)\/.+$/
|
||||
def oembed_endpoint
|
||||
"http://www.youtube.com/oembed?url=#{BaseOnebox.uriencode(@url.sub('https://', 'http://'))}&format=json"
|
||||
end
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user