Skip to content

Instantly share code, notes, and snippets.

@edavis10
Created May 18, 2009 19:19
Show Gist options
  • Save edavis10/113684 to your computer and use it in GitHub Desktop.
Save edavis10/113684 to your computer and use it in GitHub Desktop.
#
# vendor/plugins/redmine_youtube/init.rb
#
require 'redmine'
require 'open-uri'
Redmine::Plugin.register :redmine_gist do
name 'Redmine YouTube plugin'
author 'Maxime Rousseaux-Bridle <max.rb@xambr.com>'
description 'Allows a you tube video to be embeded'
version '0.0.1'
Redmine::WikiFormatting::Macros.register do
desc "Embed a you tube video"
macro :youtube do |obj, args|
%~
<object width="425" height="344">
<param name="movie" value="http://www.youtube.com/v/#{args[0]}=en&fs=1"></param>
<param name="allowFullScreen" value="true"></param>
<param name=\"allowscriptaccess\" value=\"always\"></param>
<embed src="http://www.youtube.com/v/#{args[0]}&hl=en&fs=1" type="application/x-shockwave-fla
sh" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed>
</object>
~
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment