Easily add FLV Player to Moodle

Easily add FLV Player to Moodle

by David Magill -
Number of replies: 0
Hey everyone, I have burned some brain cells on this off and on for the last few days. Although Moodle has a built in player, I wanted my traditional player, the FLV Player. Due to the Tiny editor, my code would always get messed up, and in a week I will not be the guy who would be doing these lessons. So I had to be able to give this program over to a person that has minimal experience with Moodles use. It has to be close to cut and paste. I am far from a Moodle expert!

It suddenly hit me, if the editor is messing up the FLV's call to the swfobject.js file, then put that line of code outside the editor. So I dumped it into the header.php file in my theme directory. In the root directory (with the moodle directory list) I created a js directory. In there I put swfobject.js and player.swf. More for neatness then necessity.

As an example...
edit header.php and put this script line in above the closing </head>
...
<script type="text/javascript" src="js/swfobject.js"></script>
...

Then anywhere in the page I wanted the mp3 player, I opened the HTML view and pasted my actual code.

<embed
width="300"
height="20"
src="js/player.swf"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="file=/audio/yourMP3file.mp3&autostart=true"
/>
This will work for flash movies or mp3. For movies you will have to change the height to at least 300 =-).

I tried a number of the other players and I just really like the FLV Player and it's community. My company has a licence with the FLV developers but they do have a watermarked free version.

There are some issues, if you run multiple players on a single page you will have to head over to the documentation and again the editor may cause some heartache.

When you load the page with all the lessons on it, and you have the player set to autoplay, the page will take a while to load. To remove the auto play feature remove "&autostart=true".

This forum has been hugely helpful and I hope someone finds this useful.

Thank you!

David
Average of ratings: -