Displaying Flash ( swf files) on bug display page

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
qbaas
Posts: 3
Joined: 04 Oct 2006, 20:22

Displaying Flash ( swf files) on bug display page

Post 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
Last edited by qbaas on 25 Oct 2006, 13:48, edited 1 time in total.
qbaas
Posts: 3
Joined: 04 Oct 2006, 20:22

Already did it.

Post 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
vboctor
Site Admin
Posts: 1293
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Post 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.
qbaas
Posts: 3
Joined: 04 Oct 2006, 20:22

Thanks , Victor

Post 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
skibumm101
Posts: 40
Joined: 07 Jun 2006, 16:33

Post 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
mcwizard
Posts: 14
Joined: 27 Jan 2006, 12:24

Post 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!
frentmeister
Posts: 33
Joined: 22 Jul 2005, 14:19

Re: Thanks , Victor

Post 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!!!
skibumm101
Posts: 40
Joined: 07 Jun 2006, 16:33

Post by skibumm101 »

the patch i beleive you are needing is just the code posted from the OP
frentmeister
Posts: 33
Joined: 22 Jul 2005, 14:19

Post 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!!!!
skibumm101
Posts: 40
Joined: 07 Jun 2006, 16:33

Post 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
frentmeister
Posts: 33
Joined: 22 Jul 2005, 14:19

Post 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*
talgirdas
Posts: 1
Joined: 24 Oct 2006, 12:44

Post by talgirdas »

thanks, this is really useful!
My projects:
Tramadol Info
atomoid
Posts: 108
Joined: 18 Aug 2005, 00:46
Location: santa cruz, ca

Post 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.
skibumm101
Posts: 40
Joined: 07 Jun 2006, 16:33

Post 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
Post Reply