Page 1 of 1

Displaying Flash ( swf files) on bug display page

Posted: 04 Oct 2006, 20:31
by qbaas
I have been using Mantis for my project for a while now.
Recently I discovered a great free product called Wink that enables interaction driven tutorials to be recorded and exported as flash files.

All my users are now required to save flash files before submitting a bug vs. printscreens as they used too.

I know vboctor was working on integrating cropper to save screen snapshots and display tham in mantis ( well Mantis supports displaying images in the first place)

Flash also could be embedded and displayed straight on the big report page for the hands on view.
It should not be very difficult ?

Regards,
Kuba

Already did it.

Posted: 04 Oct 2006, 22:32
by qbaas
I edited the file core/file_api.php

and after:


if ( $t_can_download &&
( $v_filesize <= config_get( 'preview_attachments_inline_max_size' ) ) &&
( $v_filesize != 0 ) &&
( in_array( strtolower( file_get_extension( $t_file_display_name ) ), array( 'png', 'jpg', 'jpeg', 'gif', 'bmp' ), true ) ) ) {

PRINT "<br /><img src=\"file_download.php?file_id=$v_id&type=bug\" />";
$image_previewed = true;
}



I have added :

// added by JK to enable displaying of SWF files
if ( $t_can_download &&
( $v_filesize <= config_get( 'preview_attachments_inline_max_size' ) ) &&
( $v_filesize != 0 ) &&
( in_array( strtolower( file_get_extension( $t_file_display_name ) ), array( 'swf' ), true ) ) ) {

PRINT "<center>";
PRINT "<OBJECT CLASSID=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" WIDTH=\"800\" HEIGHT=\"600\"CODEBASE=\"http://active.macromedia.com/flash5/cab ... on=5,0,0,0\">";
PRINT "<PARAM NAME=movie VALUE=\"file_download.php?file_id=$v_id&type=bug\">";
PRINT "<PARAM NAME=play VALUE=true>";
PRINT "<PARAM NAME=loop VALUE=false>";
PRINT "<PARAM NAME=quality VALUE=low>";
PRINT "<EMBED SRC=\"file_download.php?file_id=$v_id&type=bug\" WIDTH=\"100%\" HEIGHT=\"100%\" quality=low loop=false TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/dow ... kwaveFlash\">";
PRINT "</EMBED>";
PRINT "</OBJECT>";
PRINT "</center>";
PRINT "<br />";

$image_previewed = true;
}

The only problem is the size of the flash files.
I don't know how to do it dynamically so for now I set it to be 800x600 and than use 100% as parameters for HTML output.
It is not a beauty but it does the trick.

Hopefully somebody willfind it usefull.

Regards,
Kuba

Posted: 06 Oct 2006, 02:27
by vboctor
Thanks qbass, this looks nice. I would suggest reporting an issue in the bugtracker and attaching the patch to it.

I've installed Wink on XP and it kept crashing whenever the rendering option was triggered. Hence, I wasn't able to use the tool.

I wonder if other people had the same problem.

Regards,
Victor.

Thanks , Victor

Posted: 06 Oct 2006, 16:13
by qbaas
I will post the patch as you suggested.

As for Wink, play around with the Render options. Fo rme it works like a miracle if i use the Uncompressed flash file setting. Others cause problems ( I also use it on a XP).
The thing is that the tool is just super easy and does the best job explaining the issue keeping the size much lower than avi files ( not to mention interaction)
Here is how it looks like:
Image

Cheers,
Kuba

Posted: 10 Oct 2006, 21:45
by skibumm101
You just made a lot of people over here happy. We implimented wink and your code, and with a few tweaks and learning, we have it working perfectly

Thanks
Ryon

Posted: 11 Oct 2006, 11:40
by mcwizard
PRINT "<EMBED SRC=\"file_download.php?file_id=$v_id&type=bug\" WIDTH=\"100%\" HEIGHT=\"100%\" quality=low loop=false TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/dow ... kwaveFlash\">";
That 100% setting didn't work well for me, but with a pixel based setting it's now perfectly fine. Thanks for the patch and the Wink tip!

Re: Thanks , Victor

Posted: 12 Oct 2006, 09:32
by frentmeister
qbaas wrote:I will post the patch as you suggested.

As for Wink, play around with the Render options. Fo rme it works like a miracle if i use the Uncompressed flash file setting. Others cause problems ( I also use it on a XP).
The thing is that the tool is just super easy and does the best job explaining the issue keeping the size much lower than avi files ( not to mention interaction)
Here is how it looks like:
Image

Cheers,
Kuba
I need the Patch too, can u send it to me f.rentmeister@ascaron.com

!!!THANKS!!!

Posted: 12 Oct 2006, 17:22
by skibumm101
the patch i beleive you are needing is just the code posted from the OP

Posted: 13 Oct 2006, 12:00
by frentmeister
skibumm101 wrote:the patch i beleive you are needing is just the code posted from the OP
Oh ok, the Prob. i need more Information (Linenumbers etc.)

can u give some more Hints?

THANKS!!!!

Posted: 13 Oct 2006, 15:23
by skibumm101
the code the OP refers to is at lines 186-193, so if you put the code after that it should work, Be sure to reread the OP to make sure you understand what he is saying

Posted: 13 Oct 2006, 17:11
by frentmeister
skibumm101 wrote:the code the OP refers to is at lines 186-193, so if you put the code after that it should work, Be sure to reread the OP to make sure you understand what he is saying
Yes, thanks works...found not the line *grrr*

Posted: 24 Oct 2006, 12:45
by talgirdas
thanks, this is really useful!

Posted: 25 Oct 2006, 18:56
by atomoid
It seems there are browser-specific issues here.

I would expect the swf file to display at the original captured size in the Mantis page, howver no case does it do this, its either smaller or bigger. I tried using pixel sizes as noted in a post above to try force it to specific sizes as well as leaving the sizing info blank inhopes it would use some internal default, but it seems to make no difference either way.
Im using the Wink2.0 output from XP using defaults, maybe there are sometweaks i can make there, as it embeds some odd controll that Quicktime player seems to choke on.

Tried it in Win/Mac : Firefox/iExplorer/Safari

Anyway, did i forget to mention? this is great! Thanks.

Posted: 08 Nov 2006, 17:04
by skibumm101
well i just upgraded from 1.0.3 to 1.0.6. now this awesome feature isn't working. anybody else run into this? oh, i copied the old "file_api.php" to the new instance. am i forgetting anything?

EDIT:
I found out my problem. I had forgotten by default that the $g_preview_attachments_inline_max_size = 0; means no attachments viewed inline, so i set it to 100000 and now everything works. hopefully this will be a reminder for those that upgrade