file.php vs flash parameters

file.php vs flash parameters

by Bernard Boucher -
Number of replies: 4
Hi,
     moodle/file.php works fine with flash objets incorporated in quiz questions.

But if we have to pass parameters to the flash objet to make it more flexible and adaptable ( xxxx.swf?param1=22&param2=47 ), then the parameters are not removed from $pathname and $filename variables.

I used around lines 40 of moodle/file.php

    $pathname = "$CFG->dataroot$pathinfo";
    if ($pathbb = explode("?",$pathname)) {
        $pathname = $pathbb[0];
    }
    $filename = $args[$numargs-1];
    if ($filebb = explode("?",$filename)) {
        $filename = $filebb[0];
    }

to remove these parameters and the 2 cases seems to works fine.

Is there a better way?

Thanks,

Bernard


Average of ratings: Useful (1)
In reply to Bernard Boucher

Re: file.php vs flash parameters

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Yes, it would be very good to solve this problem, there is more and more active content out there and it's caused a few hassles.

With the fix you mention here, do the parameters still get passed to the Flash?
In reply to Martin Dougiamas

Re: file.php vs flash parameters

by Bernard Boucher -
Sure, the fix work with and without parameters with the few flash files  I have tested.

There is also another problem with Internet explorer (6.0.28 )   that don't exist with Mozilla  ( 1.5b ).

If you embed your flash in a table that use the parameter width=xxx% ( as with a question imported with the gift format ) then, the parameter width expressed in % of the flash is not reconized by IE and you only ear the sound but you see nothingangry Mozilla show the objet and give the sound.

If you express the width of the objet in pixel it work with the two browsers.

Have good testing,

Bernard



In reply to Bernard Boucher

Flash in table with % width

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Ah, IE (sigh).

So it's only a percentage (for the object) within a percentage (for the table)?

The mediaplugin player already uses pixels so that will be OK  ... this is just a trap for people writing their own Flash embedding HTML I suppose.