2013-06-29 10:43:35 -07:00
|
|
|
require_dependency 'oneboxer/base_onebox'
|
|
|
|
|
|
|
|
module Oneboxer
|
|
|
|
class FlashVideoOnebox < BaseOnebox
|
2013-11-06 17:19:02 +01:00
|
|
|
|
2013-06-29 10:43:35 -07:00
|
|
|
matcher /^https?:\/\/.*\.(swf|flv)$/
|
|
|
|
|
|
|
|
def onebox
|
2013-07-06 10:42:30 -07:00
|
|
|
if SiteSetting.enable_flash_video_onebox
|
2013-11-06 17:19:02 +01:00
|
|
|
"<object width='100%' height='100%' wmode='opaque'><param name='#{@url}' value='#{@url}'><embed src='#{@url}' width='100%' height='100%' wmode='opaque'></embed></object>"
|
2013-07-06 10:42:30 -07:00
|
|
|
else
|
|
|
|
"<a href='#{@url}'>#{@url}</a>"
|
|
|
|
end
|
2013-06-29 10:43:35 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|