Difference between revisions of "Integrated mp3 player for mythweb"

From MythTV Official Wiki
Jump to: navigation, search
 
Line 20: Line 20:
 
= Load flash loader =
 
= Load flash loader =
 
Around line 38, add a line to load the flash loader javascript file (UFO.js).
 
Around line 38, add a line to load the flash loader javascript file (UFO.js).
((Box File|/mythweb/modules/_shared/tmpl/default/header.php|
+
{{Box File|/mythweb/modules/_shared/tmpl/default/header.php|
 
<pre>
 
<pre>
 
<script type="text/javascript" src="<?php echo root ?>js/ufo.js"></script>
 
<script type="text/javascript" src="<?php echo root ?>js/ufo.js"></script>
 
</pre>
 
</pre>
))
+
}}
  
 
= Generate Playlist =
 
= Generate Playlist =
 
Inside class mythMusic, function display()
 
Inside class mythMusic, function display()
((Box File|/mythweb/modules/music/handler.php|
+
{{Box File|/mythweb/modules/music/handler.php|
 
<pre>
 
<pre>
 
//Before first if-statement, initialize the playlist
 
//Before first if-statement, initialize the playlist
Line 49: Line 49:
  
 
</pre>
 
</pre>
))
+
}}
  
 
= Load mp3 player =
 
= Load mp3 player =
 
Inside class Theme_music, new function printPlayer()
 
Inside class Theme_music, new function printPlayer()
((Box File|/mythweb/modules/music/tmpl/default/music.php|
+
{{Box File|/mythweb/modules/music/tmpl/default/music.php|
 
<pre>
 
<pre>
 
     function printPlayer() {
 
     function printPlayer() {
Line 64: Line 64:
 
     }
 
     }
 
</pre>
 
</pre>
))
+
}}
  
 
Inside class Theme_music, function print_header()
 
Inside class Theme_music, function print_header()
((Box File|/mythweb/modules/music/tmpl/default/music.php|
+
{{Box File|/mythweb/modules/music/tmpl/default/music.php|
 
<pre>
 
<pre>
 
//Around line 205, after "$this->printNavBar();"
 
//Around line 205, after "$this->printNavBar();"
 
$this->printPlayer();
 
$this->printPlayer();
 
</pre>
 
</pre>
))
+
}}
  
 
= ToDo =
 
= ToDo =
 
* Use randomly chosen (or session tagged) filename for playlist to prevent overwriting with multiple simultaneous sessions.  Alternatively, have a php script pipe the playlist directly into the flash player.
 
* Use randomly chosen (or session tagged) filename for playlist to prevent overwriting with multiple simultaneous sessions.  Alternatively, have a php script pipe the playlist directly into the flash player.
 
* (AFAIK) Flash cannot dynamically size.  The best option I see for sizing the width right now is to have a javascript grab the window size and scale the player at reload.
 
* (AFAIK) Flash cannot dynamically size.  The best option I see for sizing the width right now is to have a javascript grab the window size and scale the player at reload.

Revision as of 08:15, 5 April 2007

The purpose of this modification is two fold:

  • Eliminate the need for a local media player to play music (good for public access machines)
  • Eliminate time spend individually adding URLs to a playlist

The inspiration came from this modification. This mod is no official and is not supported by the authors of MythTV, MythWeb, or MythMusic.

Prerequisites

Required

  • mythtv
  • mythweb
  • mythmusic

Positions given below were on versions 0.20 of each above.

Install a flash mp3 player

The player used for this project is Flash MP3 Player 3.6 by Jeroen Wijering. The XSPF Web Music Player was also tried, and can easily be adapted to this mod.

The player (mp3player.swf) was installed to /mythweb/data and the flash loader (ufo.js) was installed to /mythweb/js.

Load flash loader

Around line 38, add a line to load the flash loader javascript file (UFO.js). Template:Box File

Generate Playlist

Inside class mythMusic, function display() Template:Box File

Load mp3 player

Inside class Theme_music, new function printPlayer() Template:Box File

Inside class Theme_music, function print_header() Template:Box File

ToDo

  • Use randomly chosen (or session tagged) filename for playlist to prevent overwriting with multiple simultaneous sessions. Alternatively, have a php script pipe the playlist directly into the flash player.
  • (AFAIK) Flash cannot dynamically size. The best option I see for sizing the width right now is to have a javascript grab the window size and scale the player at reload.