Project

General

Profile

Actions

Feature #5171

closed

[Flash player] Being able to embed swf files

Added by Nikolay Kotlyarov about 14 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Wiki
Target version:
-
Start date:
2010-03-24
Due date:
% Done:

0%

Estimated time:
Resolution:
Wont fix

Description

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


Files


Related issues

Related to Redmine - Feature #10138: Video PlayerClosed

Actions
Actions #1

Updated by Andrew Chaika about 14 years ago

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

Usage:

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

Actions #2

Updated by Nikolay Kotlyarov about 14 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.

Actions #3

Updated by Nikolay Kotlyarov about 14 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:(

Actions #4

Updated by Andrew Chaika about 14 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.

Actions #5

Updated by Andrew Chaika about 14 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

Actions #6

Updated by mythos mint about 14 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)

Actions #7

Updated by Patrick Fratczak almost 14 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 ...

Redmine::Plugin.register :redmine_embedded_video do
  name 'Redmine Embedded Video'
  author 'Nikolay Kotlyarov'
  description 'This is a plugin for embedding flv video'
  version '0.0.1'
end

Redmine::WikiFormatting::Macros.register do
    desc "Wiki video embedding" 

    macro :video do |o, args|
        @width = args[1] if args[1]
        @height = args[2] if args[2]
        @width ||= 400
        @height ||= 300        

        @num ||= 0

        @num = @num + 1

        attachment = o.attachments.find_by_filename(args[0])

        if attachment

            video_file = url_for (:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename)

            file_url = "#{Setting.protocol}://#{Setting.host_name.split('/').first}#{video_file}" 

        else

            file_url = args[0].gsub(/<[^\>]+>/,'')

        end

<<END
<p id='video_#{@num}'>PLAYER</p>
<script type='text/javascript' src='#{Setting.protocol}://#{Setting.host_name}/plugin_assets/redmine_embedded_video/swfobject.js'></script>

<script type='text/javascript'>
var s1 = new SWFObject('#{Setting.protocol}://#{Setting.host_name}/plugin_assets/redmine_embedded_video/player.swf','player','#{@width}','#{@height}','9');

s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');

s1.addParam('flashvars','file=#{file_url}');
s1.write('video_#{@num}');
</script>
END
  end

end

Actions #8

Updated by Patrick Fratczak almost 14 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

Actions #9

Updated by Paul Adarr over 13 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.

Actions #10

Updated by mythos mint over 13 years ago

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

require 'redmine'
Actions #11

Updated by Paul Adarr over 13 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?

Actions #12

Updated by Nikolay Kotlyarov over 13 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

Actions #13

Updated by mythos mint over 13 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 #)
Actions #14

Updated by Paul Adarr over 13 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

Actions #15

Updated by mythos mint over 13 years ago

In the redmine folder. See the upgrade instructions @ RedmineUpgrade

Actions #16

Updated by Anonymous almost 13 years 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)

Actions #17

Updated by Jun Gao about 12 years 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)

Actions #18

Updated by Daniel Morgan about 12 years 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.

Actions #19

Updated by Jun Gao about 12 years 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.

Actions #20

Updated by Claire Quillien almost 12 years 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?

Actions #21

Updated by Chris L almost 12 years 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
_________________________________________________

Actions #22

Updated by Chris L almost 12 years 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?

Actions #23

Updated by Chris Lockwood over 11 years ago

Curiously I'm having the same issue in Redmine 1.2.1

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

Actions #24

Updated by Chris Lockwood over 11 years ago

Chris Lockwood wrote:

Curiously I'm having the same issue in Redmine 1.2.1

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

Admittedly I was failing an intelligence test here by assuming everything would work fine after hitting Preview (i.e. before the upload of my SWF attachement).

That said I am experiencing another frustrating stumbling block, after going through all the motions and then reviewing my newly create Issue I'm finding that JWPlayer does't display any content ...it just sits there, with one of those circular loading content type symbols centred on a black background!

Meanwhile my production.log file looks pretty good:

Processing AttachmentsController#download (for 192.168.16.27 at 2012-07-11 11:43:00) [GET]
  Parameters: {"action"=>"download", "id"=>"183", "filename"=>"CreateProject.swf", "controller"=>"attachments"}
Completed in 10ms (View: 1, DB: 1) | 200 OK [http://MaskedURL.co.uk/attachments/download/183/CreateProject.swf]

Has anyone come across (or have a workaround for) this particular scenario?

UPDATE: code-behind excerpt from issue view:

<div class="wiki">
<p><p id='video_1'>PLAYER</p>
<script type='text/javascript' src='http://MaskedURL.co.uk/plugin_assets/redmine_embedded_video/swfobject.js'></script>
<script type='text/javascript'>
   var s1 = new SWFObject('http://MaskedURL.co.uk/plugin_assets/redmine_embedded_video/player.swf','player',' 640',' 480','9');
   s1.addParam('allowfullscreen','true');
   s1.addParam('allowscriptaccess','always');
   s1.addParam('flashvars','file=http://MaskedURL.co.uk/attachments/download/183/CreateProject.swf');
   s1.write('video_1');
</script>
</p>
</div>
Actions #25

Updated by Etienne Massip over 11 years ago

  • Category set to Wiki
Actions #26

Updated by Claire Quillien over 11 years ago

I'm experiencing the same. Havn't found any solution yet...

Actions #27

Updated by PhobosK (Dev) over 11 years ago

Hi all,
This is a lovely plugin. Thanks all.
Will be good to be in official redmine installation...
Anyway I took the liberty to modify it a bit and update it to latest SWFObject 2 and latest JW Player 5.10
This way it now supports even Youtube urls.

So i am uploading the plugin archive file.
Changelog is:
  1. SWFObject updated to v2
  2. JW Player updated to 5.10
  3. Some extra cleanup on all the arguments
  4. Fixed the error of "undefined method `attachments' ..." when using the video macro without an actual attachment existing

Probably it will be a good idea all this to be moved to the redmine plugins here, but i will leave that to the original author of the plugin...
Besides it will require some changes in the assets folder anyway..

For those of you that have problems running the plugin, please make sure you have a writable for Redmine folder: /usr/share/redmine/public/plugin_assets . In this folder there should be a subfolder named redmine_embedded_video that has everything from the PLUGIN_FOLDER/assets... If you do not have it, you may just symlink the plugin's assets folder to /usr/share/redmine/public/plugin_assets/redmine_embedded_video

Thanks.

The proposed new version has been tested and working on debian squeeze (Redmine 1.0.1), but should work on all redmine versions

Actions #28

Updated by Anton Gillert over 11 years ago

+1

Actions #29

Updated by Fabien Crespel about 11 years ago

The original issue was about embedding .swf files in wiki, issues, etc. Since I had the same requirement, I just published a redmine_embedded_flash plugin loosely inspired by the video plugin posted here.

Note that this plugin is not for videos, which are usually .flv or .mp4 files and not .swf files. My particular use case was for embedding Wink tutorials exported in .swf format.

Actions #30

Updated by Jan Pilz about 11 years ago

Made it work with Redmine 2.1.4, and updated JWPlayer also to version 6, now supports MP4, FLV, WEBM, should also work with mobile versions and html5.

Actions #31

Updated by Terence Mill about 11 years ago

in `require': /home/redmine/plugins/redmine_embedded_video/init.rb:25: syntax error, unexpected tASSOC, expecting ')' (SyntaxError)
...ile_url = url_for (:only_path=>false,:controller =>'attachme...
...                               ^
/home/redmine/plugins/redmine_embedded_video/init.rb:25: Can't assign to false
...l = url_for (:only_path=>false,:controller =>'attachments',:...
...                               ^
/home/redmine/plugins/redmine_embedded_video/init.rb:25: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
...only_path=>false,:controller =>'attachments',:action =>'down...
...                               ^
/home/redmine/plugins/redmine_embedded_video/init.rb:25: syntax error, unexpected ',', expecting keyword_end

Would be great if you create a github.com plugin repo and maintain this.
Actions #33

Updated by Jan Pilz about 11 years ago

Which version you use? init.rb line 25 was not touched by me.

Actions #34

Updated by Terence Mill about 11 years ago

Jan Pilz wrote:

Which version you use? init.rb line 25 was not touched by me.

Now i tested http://www.redmine.org/attachments/download/9145/redmine_embedded_video-0.0.3.tar.bz2 you just uploaded again?
Im am using redmine 2.2.3.

Error still there!

Actions #35

Updated by Jan Pilz about 11 years ago

Okay, i assume you are using ruby >= 1.9, there is a space between "...url_for (:only_path=>false...", ruby 1.8.7 only throw warning, ruby 1.9 throw error.

I made a fixed version.
I tested redmine 2.1.4 and 2.2.3, with ruby 1.8.7 and ruby 1.9.3.

- copy redmine_embedded_video-0.0.3.1.tar.bz2 to plugins directory
- tar xjf redmine_embedded_video-0.0.3.1.tar.bz2
- rake redmine:plugins:migrate RAILS_ENV=production
- restart redmine

syntax: {{video(<ATTACHEMENT>|<URL>|<YOUTUBE_URL>[,<width>,<height>])}}

feel free to create github repository and register it for redmine plugins :)

Actions #36

Updated by Terence Mill about 11 years ago

feel free to create github repository and register it for redmine plugins :)

Done.

https://github.com/cforce/redmine_embedded_video

Actions #37

Updated by Christine Anderssen over 10 years ago

I have just installed the plugin from Github and it works when I try and play external videos such as Youtube videos, however, it does not want to play an attached SWF file

When I view the source, I can see the URL to the attached SWF file is correct, but I still get the message
Error loading player:
No playable sources found

I have tried to play the SWF file in a standalone SWF player and it does play. The attachements folder is writeable.

Redmine and Ruby versions:

Redmine version - 2.3.1.stable
Ruby version - 1.9.3 (i386-mingw32)
Rails version - 3.2.13

Actions #38

Updated by em tv over 10 years ago

hi,

plugin version 0.0.3.1 works fine with youtube video here (Redmine 2.3.2.stable,Ruby 1.9.3-p448 [i686-linux], Rails 3.2.13) but not with vimeo urls.
would it be possible to add this feature please ?

thanks a lot, great work anyway !

Actions #39

Updated by Christine Anderssen over 10 years ago

Christine Anderssen wrote:

I have just installed the plugin from Github and it works when I try and play external videos such as Youtube videos, however, it does not want to play an attached SWF file

When I view the source, I can see the URL to the attached SWF file is correct, but I still get the message
Error loading player:
No playable sources found

I have tried to play the SWF file in a standalone SWF player and it does play. The attachements folder is writeable.

Redmine and Ruby versions:

Redmine version - 2.3.1.stable
Ruby version - 1.9.3 (i386-mingw32)
Rails version - 3.2.13

No-one else has this problem?

Actions #40

Updated by Terence Mill over 10 years ago

I confirm this!

Actions #41

Updated by Richard Rauch over 10 years ago

Hi all,
I installed the plugin on current redmine version too and encountered the same problem with SWF files :-(
The plugin is playing external youtube videos and internal .mp4 videos well.
In my opinion the plugin works well only, when JWPlayer is invoked, not the SWF player.

BUT...whith JWPlayer I am afraid of another problem. The Logo/Link to JWPlayer website is displayed in each video window. if you follow this window, you will find a legale notice, that the free version is only for "non commercial sites" !

So it seems, that everyone, who uses this plugin, is walking into a legal trap? Has anyone another opinion?
Who is able to clarify this license issue?

Actions #42

Updated by Andriy Lesyuk almost 10 years ago

Video embedding can be implemented with custom macros using WikiNG plugin (no Ruby development needed) - see this page.

Actions #43

Updated by Go MAEDA almost 6 years ago

  • Status changed from New to Closed
  • Resolution set to Wont fix

Adobe will stop updating and distributing the Flash Player at the end of 2020. This feature is no longer needed. I am closing this issue.

https://theblog.adobe.com/adobe-flash-update/

Given this progress, and in collaboration with several of our technology partners – including Apple, Facebook, Google, Microsoft and Mozilla – Adobe is planning to end-of-life Flash. Specifically, we will stop updating and distributing the Flash Player at the end of 2020 and encourage content creators to migrate any existing Flash content to these new open formats.

Actions

Also available in: Atom PDF