Using Moodle standard media player.

Using Moodle standard media player.

ni henny jellema -
Number of replies: 3
Beste Gordon,

I have been a bit too optimistic in thinking I understood how to work with the standard Moodle player. Would you mind to enlihgten me one time more?

This is what you wrote in the other message:

In case anyone wants to try this at home, here are the find and replace patterns I used:

find this:
]*>.*?]*>.*?

and replace it with this:


When using these patterns, you will need to change "http://lesnet.minkema.nl/elo/moodletest" to the URL of your Moodle site.


This is the code I normally use and do put straight in the hot pot application:



My question is: where is?
]*>.*?]*>.*?

I recognize some of it, like FlashVars, but particular I don't see pieces between [ ] ...

What to do?

Hartelijke groeten van Henny.
Average of ratings: -
In reply to henny jellema

Re: Using Moodle standard media player.

ni Gordon Bateson -
Larawan ng Core developers Larawan ng Peer reviewers Larawan ng Plugin developers
Hi Henny,
when I read your message a couple of questions popped into my mind.

The first question was, " Do you have DreamWeaver", because the patterns I mentioned were intended for use with DreamWeaver. They may also work in other programs which can use "regular expression" patterns. However, they wont' work in an ordinary text editor like "WordPad".

The second question was "Why aren't the patterns complete?" The patterns that you quote in your message are not the same as the one's I wrote in my original post.

My original post is viewable online at: http://moodle.org/mod/forum/discuss.php?d=25759&parent=122651

In my original message the "find" pattern has about 100 characters, but in your post it has only 12. Similarly, the "replace" pattern has been shortened from about 500 characters to ... nothing (at least I couldn't see it in my browser thoughtful).

So first, I would like to check those two things, namely that you have DreamWeaver (or something similar), and secondly that the "find" and "replace" patterns are about 100 and 500 characters respectively. If that is the case, you should only need to cut and paste the patterns into DreamWeaver, check the "regular expression" checkbox, and click "Replace All".

Perhaps you don't have DreamWeaver? In which case you will need to find and replace the media players by hand. The media players are defined using <object> tags.

To replace a media player by hand, try this:
  1. open the quiz's HTML file in a text editor
  2. locate a tag which signals the start of a media player, i.e "<object"
  3. write down the name of the media file name. The media file name is usually in one of the <param> tags soon after the <object> tag.
    e.g. <param name="FlashVars" value="TheSound="my-sound-file.mpg">
  4. locate the tags which signals the end of the media player, i.e. "</object>"
  5. replace all the text from the start of the media player to the end of the media player with the following text:

    <object class="mediaplugin mp3" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="90" height="15" id="mp3player"> <param name="movie" value="http://lesnet.minkema.nl/elo/moodletest/filter/mediaplugin/mp3player.swf?src=$1" /> <param name="quality" value="high" /> <param name="bgcolor" value="#333333" /> <param name="flashvars" value="waitForPlay=yes" /></object>

  6. locate the "$1" in the text in the step 5
  7. replace the "$1" in step 5 with the media file name that you wrote down in step 3
  8. repeat these steps until all the media players have been replaced
That is the "manual" way to replace your media players. I shouldn't think it is much fun to do a lot of these. If at all possible, I recommend trying to replace the media players using software that can use "regular expression" patterns

If you have time, please write back and let us know how you get on.

all the best
Gordon
In reply to Gordon Bateson

Re: Using Moodle standard media player.

ni henny jellema -
Beste Gordon,
nahihiya
Oh boy,I think I do not deserve your kind reaction, because I dó have Dreamweaver in the house. Sorry, sorry, for neglecting that question; I didn't realise it was that important.
The thing is I do not use it. I am afraid Martin is seeing it; it is WYSIWG more or less, isn't it? I am a bit afraid of Martin, you see ...ngiti

You blame him for me not being familiar with it.

I use indeed Notepad, HTML-kit a lot and when I am lazy or in a hurry, I take Frontpage. SSSSsssst!!!.... don't tell thát to Martin certainly!! The steam will come out of his ears!

But maybe I should formulate my question different.

I want to make a new exercise in Moodle. Not "repairing" an old one, because that's all done by you. Still thank you so much for all that work. My students worked with it last Thursday and things went smoothly.

But even with posting the code pasted in Dreamweaver I don't see the mp3 file name. I should be called somewhere, I think.

When I am going to make a new exercise can I copy that piece of code of you between object and object straight in my potatoe?
And I think I understand that after that, I have to activate the right setting at the edit page. But that's the last thing to do.

Hartelijke groeten van Henny.
In reply to henny jellema

Re: Using Moodle standard media player.

ni Gordon Bateson -
Larawan ng Core developers Larawan ng Peer reviewers Larawan ng Plugin developers
Dear Henny,
here's an example of text to add a sound file to a quiz.

<object class="mediaplugin mp3" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="90" height="15" id="mp3player"> <param name="movie" value="http://lesnet.minkema.nl/elo/moodletest/filter/mediaplugin/mp3player.swf?src=my-sound-file.mp3" /> <param name="quality" value="high" /> <param name="bgcolor" value="#333333" /> <param name="flashvars" value="waitForPlay=yes" /></object>

This example tells the browser to insert the Moodle media player and to then pass certain settings to the Moodle media player. One of those settings is the name of the sound file, which in this example is "my-sound-file.mp3".

In the middle of the text you can see "src=my-sound-file.mp3". This is the text which tells the Moodle media player what sound file to play. If you want to play a different file, for example "happy-sounds.mp3", you would change this part of text to "src=happy-sounds.mp3".

The above text is NOT a regular expression, so you don't need any fancy software to insert it. Any text editor will do the job. Probably any WYSIWYG html-editor can do it. However the easiest way, is to insert this text straight into your quiz using the Hot Potatoes programs.

Hope this helps and I look forward to seeing lots of new quizzes on your site ngiti

Hartelijke groeten van Gordon

P.S. I enjoyed your graphic description of "Martin". Probably you were referring to Martin Holmes, one of the fabulous co-creators of Hot Potatoes? Perhaps you should know that the creator and lead-developer of Moodle is also a Martin: Martin Dougiamas. What's more there are several other very fabulous and influential Martins connected with Moodle. It can be confusing big grin