23 lines
1.3 KiB
Plaintext
23 lines
1.3 KiB
Plaintext
<%
|
|
require 'RMagick'
|
|
image = Magick::Image::from_blob(content[0]).first
|
|
%>
|
|
<a class='flowplayer-video<%= render_type == 'inline' ? " externalfilterinline" : "" %>' href='<%= ActionController::Base.relative_url_root + "/wiki_external_filter/#{macro}.flv?name=#{name}" %>' title='<%= h source %>' style='display:block;width:<%= image.columns %>px;height:<%= image.rows + 24 %>px;background-image:url(<%= url_for(:controller => 'wiki_external_filter', :action => 'filter', :macro => macro, :name => name, :index => 0) %>);background-repeat:no-repeat'><%= image_tag 'play_large.png', :plugin => 'wiki_external_filter', :style => "display:block;position:relative;left:#{image.columns / 2 - 83 / 2}px;top:#{image.rows / 2 - 83 / 2}px" %></a>
|
|
<%
|
|
content_for :header_tags do
|
|
if not @flowplayer_scripts_included
|
|
@flowplayer_scripts_included = true
|
|
%>
|
|
<%= javascript_include_tag 'flowplayer.min.js', :plugin => 'wiki_external_filter' %>
|
|
<script language="JavaScript" type="text/javascript">
|
|
//<![CDATA[
|
|
window.onload = function () {
|
|
flowplayer("a.flowplayer-video", "<%= ActionController::Base.relative_url_root + Engines::RailsExtensions::AssetHelpers.plugin_asset_path('wiki_external_filter', 'javascripts', 'flowplayer.swf') %>", { clip: { bufferLength: 1 } });
|
|
};
|
|
//]]>
|
|
</script>
|
|
<%
|
|
end
|
|
end
|
|
%>
|