mp3 player module for G3

bburnett

Joined: 2008-09-03
Posts: 77
Posted: Mon, 2012-08-20 00:54

I was wondering can somebody please write a Module to play MP3 files, if not, no big deal, but it would give G3 a little more functionality.
I'm surprised G3 can not play mp3 files since the audio codec in .flv files is .mp3

I thank you for your time and consideration, sincerely,
bburnett

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

"sometimes the world is cruel to shiny things" - Elroy "Lucky" Kleinschmidt

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2012-10-11 23:39

Use G2 if this feature is so important to you.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-10-12 01:26
 
punctuation

Joined: 2012-12-11
Posts: 37
Posted: Sun, 2012-12-16 23:31

Here is a workaround:

====

Download:
XSPF Web Music Player (it is open source)
http://musicplayer.sourceforge.net/

Upload it to your server:
http://www.yoursite.com/music/

Upload mp3s into same folder.

====

Make index.html in www.yoursite.com/music:

<html>
<body>

<object type="application/x-shockwave-flash" width="400" height="170"
data="http://www.yoursite.com/music/xspf_player.swf?playlist_url=http://www.yoursite.com/music/yourplaylistlist.xspf">
<param name="movie"
value="http://www.yoursite.com/music/xspf_player.swf?playlist_url=http://www.yoursite.com/music/yourplaylistlist.xspf" />
</object>

</body>
</html>

====

Make yourplaylistlist.xspf
Info: http://xspf.org/quickstart/

<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
<track><location>http://www.yoursite.com/music/song_1.mp3</location></track>
<track><location>http://www.yoursite.com/music/song_2.mp3</location></track>
<track><location>http://www.yoursite.com/music/song_3.mp3</location></track>
</trackList>
</playlist>

Upload yourplaylistlist.xspf to www.yoursite.com/music/

====

Download and install module: code block
http://codex.gallery2.org/Gallery3:Modules:code_block

====

Admin > Settings > Code Block

Enter the title of the block: Music

Nothing for HTML code

Check > 'Show on album & collection pages'

Save

====

Edit: yoursite.com/gallery3/modules/code_block/views/code_block.html.php

delete:

<?= module::get_var("code_block", "code"); ?>

and add:

<html>
<head>
<script type="text/javascript">
// Popup window code
function newPopup(url) {
popupWindow = window.open(
url,'popUpWindow','height=190,width=420,left=10,top=10,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=no')
}
</script>
</head>
<body>

<a href="JavaScript:newPopup('http://www.yoursite.com/music/');">Play music</a>

</body>
</html>

====

Enjoy the music!

====

Instead of text link you can make image link:
<a href="JavaScript:newPopup('http://www.yoursite.com/music/);"><img src="http://www.yoursite.com/music/playbutton.jpg"></a>

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2012-12-17 13:55

You should encourage HTML5 <audio /> as flash based solution are not supported on mobile devices.
Like I did in my solution.
And don't tell me mine does not work on old browser's like FF 3.x or IE8 or Seamonkey because it could easily be tweaked to do so and you are talking about insignificant ~0.0013% web metrics.

And we are looking forwards not backwards.

-s
________________________________
All New jQuery Minislideshow for G2/G3