I need a value that I can read in the init.rb and also change it through the plugin settings on Redmine:
https://i.stack.imgur.com/eNPgw.png
https://i.stack.imgur.com/8nMAy.png
Here is my init.rb from the plugin:
require 'redmine'
Redmine::Plugin.register :redmine_embedded_video do
name 'Redmine Embedded Video'
author 'Nikolay Kotlyarov, PhobosK, Jan Pilz'
description 'Embeds attachment videos, video URLs or Youtube videos. Usage (as macro): video(ID|URL|YOUTUBE_URL). Updated to JW Player 6.2.3115, SWFObject removed'
url 'http://www.redmine.org/issues/5171'
version '0.0.3.1'
#Hier ist die plugin configuration:
settings :default => {'empty' => true}, :partial => 'settings/video_settings'
end
Redmine::WikiFormatting::Macros.register do
desc "Wiki video embedding"
macro :video do |o, args|
@ratio = args[1] if args[1]
@ratio ||= "16:9"
@num ||= 0
@num = @num + 1
attachment = o.attachments.find_by_filename(args[0]) if o.respond_to?('attachments')
if attachment
file_url = url_for(:only_path => false, :controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename)
else
file_url = args[0].gsub(/<.*?>/, '').gsub(/<.*>/,'')
end
out = <<END
<script type="text/javascript" src="#{request.protocol}#{request.host_with_port}#{ActionController::Base.relative_url_root}/plugin_assets/redmine_embedded_video/jwplayer.js"></script>
<script type="text/javascript">
jwplayer.key="HERE IS WHERE I NEED THE VALUE 'TEST1'";
</script>
<div id="video_#{@num}">Loading the player ...</div>
<script type="text/javascript">
jwplayer("video_#{@num}").setup({
file: "#{file_url}",
image: 'images/video_dummy.jpg',
width: "100%",
aspectratio: "#{@ratio}"
});
</script>
END
out.html_safe
end
jwplayer.key: Is where I need the value 'TEST1'
Thanks in advance :)