How do I remove the MP3 Player background?

How do I remove the MP3 Player background?

by Lester Cunningham -
Number of replies: 5

Whenever I add an MP3 file as a resource I get the standard player but it always appears within a black square box. I have tried changing the colours in the theme settings but these only apply to the player itself and not this annoying black square that it sits in.  I have seen that others have overcome this problem but I am still struggling.  Any advice would be appreciated.

Thanks.

Lester

Average of ratings: -
In reply to Lester Cunningham

Re: How do I remove the MP3 Player background?

by Mauno Korpelainen -

Edit theme config.php and change both

$THEME->resource_mp3player_colors =
 'bgColour=ffffff&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
 'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';

/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.

and

$THEME->filter_mediaplugin_colors =
 'bgColour=ffffff&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
 'waitForPlay=yes';

You could also edit file filter/mediaplugin/filter.php and

function mediaplugin_filter_mp3_callback($link) {
    global $CFG, $THEME;

    if (!empty($THEME->filter_mediaplugin_colors)) {
        $c = $THEME->filter_mediaplugin_colors;   // You can set this up in your theme/xxx/config.php
    } else {
        $c = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
             'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
             'waitForPlay=yes';
    }
    $c = htmlentities($c);

    static $count = 0;
    $count++;
    $id = 'filter_mp3_'.time().$count; //we need something unique because it might be stored in text cache

    $url = addslashes_js($link[1]);

    return $link[0].
'<span class="mediaplugin mediaplugin_mp3" id="'.$id.'">('.get_string('mp3audio', 'mediaplugin').')</span>
<script type="text/javascript">
//<![CDATA[
  var FO = { movie:"'.$CFG->wwwroot.'/filter/mediaplugin/mp3player.swf?src='.$url.'",
    width:"90", height:"15", majorversion:"6", build:"40", flashvars:"'.$c.'", quality: "high" };
  UFO.create(FO, "'.$id.'");
//]]>
</script>';
}

or edit classes span.mediaplugin and span.mediaplugin_mp3 in theme css.

In reply to Mauno Korpelainen

Re: How do I remove the MP3 Player background?

by Lester Cunningham -

Thanks Mauno, but I've tried changing colours via this route and it just changes the player background colour, not the square behind it.  See the screen grab to see what I mean.

http://go.nhslearn.com/player.jpg

I'd like the background to blend into the theme background colour and to be able to position the player at the top of the screen also.

Cheers.

In reply to Lester Cunningham

Re: How do I remove the MP3 Player background?

by Mauno Korpelainen -
I haven't seen such squares so it might come from some css class before the player tags - checking source code and firefox Web Developer plugin (CSS -> View Style Information) might help to find the source of that square. Do you have some demo course I could visit?
In reply to Lester Cunningham

Re: How do I remove the MP3 Player background?

by Felix Berger -
I have the same problem, a big square box is beeing displayed around the player. Though, in my case the square is white. No Idea, which css attribute is producing this.