Forum OpenACS Development: Embedding flash video player

Collapse
Posted by Dave Bauer on
Does anyone have an implementation of a reusable flash video player for embedding into OpenACS pages?

We want something like an ADP include where we can just point a URL to an FLV file on the server and have a flash video player embedded in the page.

Collapse
Posted by Jon Griffin on
If you use xowiki it is built in. For an example see:

http://salsablanca.com/ethno/changui-video

This is the code you need:

[[swf:changui-promo1.swf|Video of traditional cuban changüi being played in Havana Cuba|-width 320px -height 234px -quality high -wmode transparent]]

For raw adp, this may help
http://salsablanca.com/ethno/casino-rueda
is using:
I did this before I asked Gustaf to add this as a wiki type.

<div id="flashcontent"> This text is replaced by the Flash movie.
</div>
&lt;script type="text/javascript"&gt;
var so = new SWFObject("/movies/Ban Rarra on Malecon.swf", "casinorueda", "359", "282", "7", "#336699");
so.addParam("quality", "high");
so.addParam("wmode", "transparent");
so.addParam("salign", "t");
so.write("flashcontent");

It is using the swfObject js library, don't remember where I got it.

Hope that helps.

Collapse
Posted by Gustaf Neumann on
swfObject.js is shipped with xowiki, and included on demand on pages, where swf files are used....
Collapse
Posted by Dave Bauer on
Thanks!

This helps but does not solve the issue of accessing the FLV. For that I need an SWF that takes an argument of the URL pointing to the FLV. Once I have that SWF I can add it to a page using the swfobject code.

Collapse
Posted by Gustaf Neumann on
The idea of the xowiki usage is to write to your page e.g.

[[swf:demo.swf|Demo|-menu true]]

if the file does not exist, one can upload it using the provided link. If for some reason, you cannot upload it to the content repository, it does not help currently. extending the link syntax for external references seems possible to me.

Collapse
Posted by Dave Bauer on
The SWF I have takes a flashvar parameter.

I added a addvars parmaeter to the SWF link type. Its used like so:

[[swf:flvplayer.swf|This is the title|-addvars {file http://mysite.org/xowiki/file/some_flash_video.flv}]]

I added this to the swf render_found instproc.

if {[my exists addvars]} {
foreach {name value} [my set addvars] {
append addParams "so.addVariable('${name}','${value}');\n"
}
}

And added addvars as a parameter for the swf subclass.
I still can't see the video though so I might have missed a step. I am still working on it.

Collapse
Posted by Dave Bauer on
[[swf:flvplayer.swf|This is the title|-addvars {file http://mysite.org/xowiki/file/some_flash_video.flv?m=download}]]

Need to add the ?m=download to make sure you have the download URL for the FLV not the admin page.

Collapse
Posted by Dave Bauer on
This unfortunately doesn't work
Since the file url is passed as a URL variable
it needs to be URLencoded I'd say
But it did not work

Posted by Dave Bauer on 07/27/07 03:35 PM
[[swf:flvplayer.swf|This is the title|-addvars {file http://mysite.org/xowiki/file/some_flash_video.flv%3fm%3ddownload}]]

Did not work either It got translated into some HTML entity and I could not download the FLV from the player. Any ideas?

I am using http://www.jeroenwijering.com/?item=JW_FLV_Player

Collapse
Posted by Gustaf Neumann on
for some podcast clients, the m=download was a problem as well, since they have problems with the query part of urls. therefore, when i wrote the podcast support, i added an alternative writing for downloads without query variables. The orginal syntax was to complicated, i have just now simplified this to

http://mysite.org/xowiki/download/file/some_flash_video.flv

maybe this helps here as well a little.

Collapse
Posted by Gustaf Neumann on
yes, the flash support was built primarily for .swf files having everything included (e.g. flv). not sure, what is the best way to build such files.
Collapse
Posted by Dave Bauer on
I got it working by using the file upload plugin I created (no URL vars in the URL for the FLV) and adding the video/x-flv mime type to the config.tcl.
Collapse
Posted by Jon Griffin on
What encoding software are you using? I only use camtasia or flixpro or sorenson squeeze. These build in the player as a single file.

flv is notoriously bad for this as (I believe) you can't easily embed the player in the file.

Can you save the file as an swf instead. There really is not that much difference.

Here is a general site I used for settings.
http://www.squidoo.com/youtuberight/

Collapse
Posted by Nima Mazloumi on
How can I tell xowiki to include some js files that need to be uploaded? I have a flash film that works via liveconnect with some javascript that are not embedded in the html but in external files.
Collapse
Posted by Nima Mazloumi on
Something like

[[js:filename.js|sometitle]] would be great. This doesnt exist. Shall I create something like that?

We could have something similar for css:

[[css:filename.css|sometitle]]

Any idea?

Collapse
Posted by Gustaf Neumann on
The major question is whether this is something which should be allowed to everybody. An option is to extend the permitted values in the form.constraints to allow to add css and js. Will look into this...
Collapse
Posted by Nima Mazloumi on
Permitted values would be one option and permissions another. So I could allow admins to upload js and css and users not.
Collapse
Posted by Eduardo Santos on
Hi everybody,

I'm trying to follow your instructions to put a flash video in my page, but the extra parameters for the video, such as height and width don't work. It doesn't matter how I change these parameters the video allways has the same height and width. This is the code I put in XoWiki to include the videos:

[[swf:invesalius2_video07_segmentacao_stl.swf|InVesalius 2.0|-width 620 -height 465]]

It shows mw the following error message:

Error during processing of options: during '::2433187::link height'

Looking at the code, I've realized that in the file /xowiki/tcl/link-procs.tcl, it forces the width:

::xowiki::Link::swf instproc render_found {href label} {
::xo::Page requireJS /resources/xowiki/swfobject.js
my instvar package_id name
#set link [$package_id pretty_link -absolute true -siteurl http://localhost:8003 $name]/download.swf
foreach {width height bgcolor version} {320 240 #999999 7} break

Is it impossible to change these parameters?

Collapse
Posted by Gustaf Neumann on
the passing of values for height and width for the swf-files works both in the oacs-5-3 version and in the version in cvs-head.

There must be something else wrong. concerning the error message with height: are you sure, you have no "invisible markup" (such as spans etc. introduced via cut&paste) around the "-height"?

concerning setting the value:
the line, you are highlighting is the line setting the default values. the line below this (not cited) sets the provided values.

the height is passed to "new SWFObject(...,$height,...)". You should check the generated HTML source, whether it is inserted correctly at that place. btw, not every swf file honors the width and height parameters.

hope this helps.

Collapse
Posted by Eduardo Santos on
Thank you very much Gustaf. As always, you are absolutely right. I didn't think about the generated HTML code, but there was an span tag, as you suggested. This tag was making it impossible for XoWiki to get the right values.

At least I can understand a little bit more about XoTCL now. Thank you for your help again.

Collapse
Posted by Gustaf Neumann on
my guess was due to the fact that i was caught earlier by a similar problem; the insertion of such tags is partly a problem of the rich text editor.

in the current head version, the error message will be easier to spot.

Collapse
Posted by Stephen Wong on
If you know actionscript, you can make a flash video player manually, but I think it is too technical. I heard that JW flv player is good, I tried, I found it is difficult to add plug-ins to the player. I think Moyea web player pro is easy to use, it is a flash video player maker.
Collapse
Posted by Tom Szymkowiak on
Try this one player: http://flv-player.web-anatomy.com/, You shouldn't have any problems with installation/integration and configuration, You can control everything via control panel