Feature #5171

[Flash player] Being able to embed swf files

Added by Nikolay Kotlyarov about 2 years ago. Updated 14 days ago.

Status:New Start date:2010-03-24
Priority:Normal Due date:
Assignee:Jean-Philippe Lang % Done:

0%

Category:-
Target version:-
Resolution:

Description

The request is:
being able to embed swf files(to wiki pages, issues, etc.)
like it is now for images.

redmine_embedded_video.zip (88 kB) Andrew Chaika, 2010-03-24 19:02

redmine_embedded_video.zip (300.2 kB) Daniel Morgan, 2012-03-26 02:57


Related issues

related to Feature #10138: Video Player New

History

#1 Updated by Andrew Chaika about 2 years ago

I use this simple plugin for embedding flash player into wiki/issues/blog

Usage:

{{video(<name of attachement>)}}

#2 Updated by Nikolay Kotlyarov about 2 years ago

Andrew Chaika wrote:

I use this simple plugin for embedding flash player into wiki/issues/blog

Usage:

{{video(<name of attachement>)}}

Wow, thanks a lot!:)
It definitely should reside at least on plugins page!

Would like to have this macro in 1.0, as far as it's rather lightweight.

#3 Updated by Nikolay Kotlyarov about 2 years ago

Andrew Chaika wrote:

I use this simple plugin for embedding flash player into wiki/issues/blog

Usage:

{{video(<name of attachement>)}}

The macro returns error

Error executing the video macro (undefined method `attachments' for #)

Redmine version: 0.9.3.
Don't know how to make it work:(

#4 Updated by Andrew Chaika about 2 years ago

I'm using it on Redmine 0.9.3.devel.3525 (MySQL) now and on 0.8.x.devel in the past without such problem.
I'll check it on 0.9.3 version.

#5 Updated by Andrew Chaika about 2 years ago

PS Sorry, the purpose of this plugin is to embedding flash video with player into redmine wiki, but it can be changed or modified (added new macro) to embed swf files

#6 Updated by mythos mint about 2 years ago

I tried this plugin in these redmine versions and got the same error:

Error executing the video macro (undefined method `attachments' for #)

Here is the code I used:

{{video(vid.swf)}}

Redmine 0.8.7.stable (MySQL)
Redmine 0.9.3.stable (MySQL)

#7 Updated by Patrick Fratczak almost 2 years ago

Hello,

I have made a modification to be allowed to specify the size of the embedded video player.
And also to have your plugin registered to the plugin list ...

 1Redmine::Plugin.register :redmine_embedded_video do
 2  name 'Redmine Embedded Video'
 3  author 'Nikolay Kotlyarov'
 4  description 'This is a plugin for embedding flv video'
 5  version '0.0.1'
 6end
 7
 8Redmine::WikiFormatting::Macros.register do
 9    desc "Wiki video embedding" 
10
11    macro :video do |o, args|
12        @width = args[1] if args[1]
13        @height = args[2] if args[2]
14        @width ||= 400
15        @height ||= 300        
16
17        @num ||= 0
18
19        @num = @num + 1
20
21        attachment = o.attachments.find_by_filename(args[0])
22
23        if attachment
24
25            video_file = url_for (:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename)
26
27            file_url = "#{Setting.protocol}://#{Setting.host_name.split('/').first}#{video_file}" 
28
29        else
30
31            file_url = args[0].gsub(/<[^\>]+>/,'')
32
33        end
34
35<<END
36<p id='video_#{@num}'>PLAYER</p>
37<script type='text/javascript' src='#{Setting.protocol}://#{Setting.host_name}/plugin_assets/redmine_embedded_video/swfobject.js'></script>
38
39<script type='text/javascript'>
40var s1 = new SWFObject('#{Setting.protocol}://#{Setting.host_name}/plugin_assets/redmine_embedded_video/player.swf','player','#{@width}','#{@height}','9');
41
42s1.addParam('allowfullscreen','true');
43s1.addParam('allowscriptaccess','always');
44
45s1.addParam('flashvars','file=#{file_url}');
46s1.write('video_#{@num}');
47</script>
48END
49  end
50
51end

#8 Updated by Patrick Fratczak almost 2 years ago

Patrick Fratczak wrote:

Hello,

I have made a modification to be allowed to specify the size of the embedded video player.
And also to have your plugin registered to the plugin list ...

[...]

You just now have to specify the size

video(my_video.flv,640,480) for example

#9 Updated by Paul Adarr almost 2 years ago

Does this plugin work?
I added it to the plugins folder .. do i need to restart redmine service or the server itself?
It do't get a button like the add image or link button.

#10 Updated by mythos mint almost 2 years ago

Worked for me. The plugin wasn't registering because it was missing this line at the very top

1require 'redmine'

#11 Updated by Paul Adarr almost 2 years ago

What folder do I put the "Init.rb" and the "Assets" folder in.

Currently I have them C:\Program Files\BitNami Redmine Stack\apps\redmine\lib\plugins
Is this the correct folder?

If this is working correctly will it automatically show up in the Admin pages under Plugins?
or are there additional steps that i'm not finding?

#12 Updated by Nikolay Kotlyarov almost 2 years ago

Paul Adarr wrote:

Currently I have them C:\Program Files\BitNami Redmine Stack\apps\redmine\lib\plugins
Is this the correct folder?

http://www.redmine.org/wiki/redmine/Plugins
use /vendor/plugins instead of \lib\plugins

#13 Updated by mythos mint almost 2 years ago

Just FYI: This plugin only worked for me on Version 1 or above.

On redmine 0.9.6 I still get the error:

Error executing the video macro (undefined method `attachments' for #)

#14 Updated by Paul Adarr almost 2 years ago

OK i had it working but ended up needing to reinstall Redmine to fix another issue.
I'm using ver. 1.0.0 of redmine and 0.8.7 Ruby stack

I can't remember what folder i'm supposed to "cd" to for running the command

rake db:migrate_plugins RAILS_ENV=production

I thought it was the ../vendor/plugins
I tried that and ../vendor/plugins/embedded_video_player

#15 Updated by mythos mint almost 2 years ago

In the redmine folder. See the upgrade instructions @ RedmineUpgrade

#16 Updated by Denis Kostrom about 1 year ago

Hello. I have a problem with using this plugin.
I get the error in log. Can you help me, where is mistake?

Processing ApplicationController#index (for 10.8.0.117 at 2011-04-08 11:48:23) [GET]

ActionController::RoutingError (No route matches "/plugin_assets/redmine_embedded_video/swfobject.js" with {:method=>:get}):
  /usr/lib/ruby/1.8/action_controller/routing/recognition_optimisation.rb:66:in `recognize_path'
  /usr/lib/ruby/1.8/action_controller/routing/route_set.rb:441:in `recognize'
  /usr/lib/ruby/1.8/action_controller/routing/route_set.rb:436:in `call'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:87:in `dispatch'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:121:in `_call'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:130:in `build_middleware_stack'
  /usr/lib/ruby/1.8/active_record/query_cache.rb:29:in `call'
  /usr/lib/ruby/1.8/active_record/query_cache.rb:29:in `call'
  /usr/lib/ruby/1.8/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
  /usr/lib/ruby/1.8/active_record/query_cache.rb:9:in `cache'
  /usr/lib/ruby/1.8/active_record/query_cache.rb:28:in `call'
  /usr/lib/ruby/1.8/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
  /usr/lib/ruby/1.8/action_controller/string_coercion.rb:25:in `call'
  /usr/lib/ruby/1.8/rack/head.rb:9:in `call'
  /usr/lib/ruby/1.8/rack/methodoverride.rb:24:in `call'
  /usr/lib/ruby/1.8/action_controller/params_parser.rb:15:in `call'
  /usr/lib/ruby/1.8/action_controller/session/cookie_store.rb:93:in `call'
  /usr/lib/ruby/1.8/action_controller/failsafe.rb:26:in `call'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `call'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `synchronize'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `call'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:106:in `call'
  /usr/lib/ruby/1.8/rack/content_length.rb:13:in `call'
  /usr/lib/ruby/1.8/rack/handler/fastcgi.rb:57:in `serve'
  public/dispatch.fcgi:24

Rendering /usr/share/redmine/public/404.html (404 Not Found)

#17 Updated by Jun Gao 2 months ago

anyone managed to make it work on redmine 1.3.0? I extract it under vendor\plugins, and I got this error

Error executing the video macro (undefined method `attachments' for nil:NilClass)

#18 Updated by Daniel Morgan about 1 month ago

Attaching a copy of the plugin I have working under 1.3.x.
Make sure you run rake db:migrate_plugins RAILS_ENV=production.

#19 Updated by Jun Gao about 1 month ago

Hi Daniel, thanks, mine's working now. really appreciate.
Daniel Morgan wrote:

Attaching a copy of the plugin I have working under 1.3.x.
Make sure you run rake db:migrate_plugins RAILS_ENV=production.

#20 Updated by Claire Quillien 21 days ago

Hello,
I installed the plugin. This installation seems to work (a screen appears in my wiki page), but the video never loads (I have the round shape still turning).
Do you have any idea what this could come from?

#21 Updated by Chris L 15 days ago

Having some issues as well. I am on 1.3.3. I installed the pluging. Go to my wiki page, add

Cert renewal

{{video(History.flv)}}

then attach my file but all i get is ....
__________________________________________________________
Cert renewal

PLAYER

History.flv (4.9 MB) Admin, 05/09/2012 09:47 am
New file
_________________________________________________

#22 Updated by Chris L 14 days ago

OK so now I am getting

Error executing the video macro (undefined method `attachments' for nil:NilClass)

How do you upload the video file?

Also available in: Atom PDF