Displaying Flash ( swf files) on bug display page

Post about your customizations to share with others.

Moderators: Developer, Contributor

Displaying Flash ( swf files) on bug display page

Postby qbaas » Oct 04, 2006 3:31 pm

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 Oct 25, 2006 8:48 am, edited 1 time in total.
qbaas
 
Posts: 3
Joined: Oct 04, 2006 3:22 pm

Already did it.

Postby qbaas » Oct 04, 2006 5:32 pm

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&amp;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/cabs/swflash.cab#version=5,0,0,0\">";
PRINT "<PARAM NAME=movie VALUE=\"file_download.php?file_id=$v_id&amp;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&amp;type=bug\" WIDTH=\"100%\" HEIGHT=\"100%\" quality=low loop=false TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">";
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
qbaas
 
Posts: 3
Joined: Oct 04, 2006 3:22 pm

Postby vboctor » Oct 05, 2006 9:27 pm

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.
vboctor
Site Admin
 
Posts: 1271
Joined: Feb 13, 2005 5:11 pm
Location: Redmond, Washington

Thanks , Victor

Postby qbaas » Oct 06, 2006 11:13 am

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

Postby skibumm101 » Oct 10, 2006 4:45 pm

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

Postby mcwizard » Oct 11, 2006 6:40 am

PRINT "<EMBED SRC=\"file_download.php?file_id=$v_id&amp;type=bug\" WIDTH=\"100%\" HEIGHT=\"100%\" quality=low loop=false TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">";


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

Re: Thanks , Victor

Postby frentmeister » Oct 12, 2006 4:32 am

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

Postby skibumm101 » Oct 12, 2006 12:22 pm

the patch i beleive you are needing is just the code posted from the OP
skibumm101
 
Posts: 40
Joined: Jun 07, 2006 11:33 am

Postby frentmeister » Oct 13, 2006 7:00 am

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

Postby skibumm101 » Oct 13, 2006 10:23 am

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

Postby frentmeister » Oct 13, 2006 12:11 pm

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*
frentmeister
 
Posts: 33
Joined: Jul 22, 2005 9:19 am

Postby talgirdas » Oct 24, 2006 7:45 am

thanks, this is really useful!
My projects:
Tramadol Info
talgirdas
 
Posts: 1
Joined: Oct 24, 2006 7:44 am

Postby atomoid » Oct 25, 2006 1:56 pm

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.
atomoid
 
Posts: 108
Joined: Aug 17, 2005 7:46 pm
Location: santa cruz, ca

Postby skibumm101 » Nov 08, 2006 12:04 pm

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


Return to Customizations

Who is online

Users browsing this forum: No registered users and 5 guests