Note: You are currently viewing documentation for Moodle 3.1. Up-to-date documentation for the latest stable version of Moodle is probably available here: MP3 player.

MP3 player: Difference between revisions

From MoodleDocs
mNo edit summary
(mp3 playback options)
Line 1: Line 1:
The multimedia filter embeds MP3 files in a streaming player made with [[Flash]] e.g. [http://moodle.org/mod/resource/view.php?id=2296 Moodle Features Demo: MP3 file]. The large MP3 player is used when an MP3 file is added as a [[resource]]. The small player is used when an MP3 file is linked to from within a forum post or another resource or activity using the [[HTML editor]].
The multimedia filter embeds MP3 files in a streaming player made with [[Flash]] e.g. [http://moodle.org/mod/resource/view.php?id=2296 Moodle Features Demo: MP3 file]. The large MP3 player is used when an MP3 file is added as a [[Resources|resource]]. The small player is used when an MP3 file is linked to from within a forum post or another resource or activity using the [[HTML editor]].


==MP3 player rates==
==MP3 player rates==
Line 30: Line 30:
   'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
   'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
   'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
   'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
   'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
   'font=Arial&fontColour=3333FF';
  /// With this you can control the colours of the "big" MP3 player  
  /// With this you can control the colours of the "big" MP3 player  
  /// that is used for MP3 resources.
  /// that is used for MP3 resources.
Line 36: Line 36:
  $THEME->filter_mediaplugin_colors =  
  $THEME->filter_mediaplugin_colors =  
   'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
   'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
   'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
   'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&';
  'waitForPlay=yes';
  /// ...And this controls the small embedded player
  /// ...And this controls the small embedded player
==MP3 playback options==
''theme/yourtheme/config.php'' contains options for changing the playback options of the MP3 player.
* <code>waitForPlay</code> determines whether the MP3 file starts downloading as soon as the player appears on the page (<code>waitForPlay=no</code>), or whether the play button must be pressed before the MP3 file starts downloading (<code>waitForPlay=yes</code>).
* <code>autoPlay</code> determines whether the MP3 player starts playing the MP3 as soon as the player appears on the page (<code>autoPlay=yes</code>), or whether it must be fully downloaded before playing (<code>autoPlay=no</code>).
* <code>buffer</code> determines how many seconds of MP3 file downloading must elapse before the MP3 starts playing e.g. 10 seconds (<code>buffer=10</code>). This variable only applies when <code>autoPlay=yes</code>.
'''Default playback options'''
* Big MP3 player: <code>buffer=10&waitForPlay=no&autoPlay=yes</code>
* Small MP3 player: <code>waitForPlay=yes</code>


==See also==
==See also==

Revision as of 08:16, 10 May 2006

The multimedia filter embeds MP3 files in a streaming player made with Flash e.g. Moodle Features Demo: MP3 file. The large MP3 player is used when an MP3 file is added as a resource. The small player is used when an MP3 file is linked to from within a forum post or another resource or activity using the HTML editor.

MP3 player rates

To ensure that MP3 files are played at the correct rate, sample rates of 11, 22 or 44 kHz should be used.

Flash security settings

Security changes in Flash player 7 may result in the MP3 player not playing MP3 files hosted on a remote server. This issue may be resolved by writing a cross-domain policy for the remote server and/or each user changing their global security settings in the Flash player settings manager.

Cross-domain policy

To create a cross-domain policy, save the code below as crossdomain.xml and place the file at the root of the remote server.

<cross-domain-policy>
   <allow-access-from domain="www.yourmoodlesite.org" />
</cross-domain-policy>

Please refer to Macromedia - Developer Center: Security Changes in Macromedia Flash Player 7 for further details.

Global security settings

Please refer to Macromedia - Flash Player Help: Global Privacy Settings Panel.

MP3 player colours

theme/yourtheme/config.php contains options for changing the default colours (black, white and grey) of the MP3 player.

$THEME->resource_mp3player_colors = 
 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
 'font=Arial&fontColour=3333FF';
/// With this you can control the colours of the "big" MP3 player 
/// that is used for MP3 resources.
$THEME->filter_mediaplugin_colors = 
 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&';
/// ...And this controls the small embedded player

MP3 playback options

theme/yourtheme/config.php contains options for changing the playback options of the MP3 player.

  • waitForPlay determines whether the MP3 file starts downloading as soon as the player appears on the page (waitForPlay=no), or whether the play button must be pressed before the MP3 file starts downloading (waitForPlay=yes).
  • autoPlay determines whether the MP3 player starts playing the MP3 as soon as the player appears on the page (autoPlay=yes), or whether it must be fully downloaded before playing (autoPlay=no).
  • buffer determines how many seconds of MP3 file downloading must elapse before the MP3 starts playing e.g. 10 seconds (buffer=10). This variable only applies when autoPlay=yes.

Default playback options

  • Big MP3 player: buffer=10&waitForPlay=no&autoPlay=yes
  • Small MP3 player: waitForPlay=yes

See also