Created
January 19, 2010 09:01
-
-
Save timmatheson/280788 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def quicktime_movie(url, options = {}) | |
filename = url.scan(/\w+\.mov$/) | |
url.gsub!(filename) | |
object_tag_options = { | |
:CLASSID => "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B", | |
:width => "320", | |
:height => "256", | |
:codebase => "http://www.apple.com/qtactivex/qtplugin.cab" | |
}.update(options) | |
content_tag(:object, object_tag_options) do | |
content_tag(:param, :name => "src", :value => filename) {} | |
content_tag(:param, :name => "qtsrc", :value => (url + filename)) {} | |
content_tag(:param, :name => "autoplay", :value => true) {} | |
content_tag(:param, :name => "loop", :value => false) {} | |
content_tag(:param, :name => "controller", :value => true) {} | |
content_tag(:embed, | |
:src => filename, | |
:qtsrc => (url + filename), | |
:width => object_tag_options[:width], | |
:height => object_tag_options[:height], | |
:autoplay => true, | |
:loop => false, | |
:pluginspage => "http://www.apple.com/quicktime/" | |
) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment