Created by DualBase Design

www.dualbase.com

Documentation

Introduction

I know my english is not perfect but i tried to do my best
I would appreciate some help for corrections

What is FLAM Player ?

FLAM Player means FLASH MP3 Player.

This is an mp3 player built in Flash, and so, it can be integrated in an Html page. It works using PHP and MySQL. The database stores the authors and tracks characteristics, the PHP scripts manage the communication between the Flash player and the MySQL database.

FLAM Player comprises an administration module allowing the fast addition of tracks, the edition of authors or tracks characteristics, the creation of playlists and the simple integration of the player in a page.

Specifications

Version 1.5 - Player in Flash
  • Don't need the PHP WDDX library anymore on your server
  • Shuffle mode
  • Can handle external links to mp3 files
  • Autoplay mode
  • Can handle accentuate (and others specials) characters for the titles, authors and filenames
  • Automatic skip of the track if the file is unavailable
Version 1.5 - Administration module
  • Add external HTTP links to mp3 files
  • Preselect defaults playing modes for the player
    (Autoplay / Loop playlist / Loop tracks / Shuffle)
  • The permissions setting (CHMOD 777) for each new track isn't needed anymore
  • Availability of a function to create / update a playlist besides administration module (for the developers who want to dynamically create / update FLAM Player's playlists without using administration module)
  • Can handle accentuate (and others specials) characters for the titles, authors and filenames
  • The mp3 filenames are not renamed anymore, they strictly keep their originals filenames
  • More assistance and verifications in the FLAM Player installation
Version 1.0 - Player in Flash
  • Stream mp3 file (up to 44 KHz)
  • Available languages : French and English
  • Player's basic controls : Backward - Play - Pause - Stop - Forward - Volume - Mute
  • Customizable color of the player
  • Movable position cursor even if the track is not completely loaded
  • Direct access to the email / site of the author on the player
  • User's settings : balance - color - loop track - loop playlist - adjustable stream buffer
  • Fully customizable filter (authors / playlists / orders)
Version 1.0 - Administration module
  • Quasi-automatic installation page
  • Basic authentication to the administration module
  • HTTP upload of mp3 files
  • Check and correct filenames (take care of special characters)
  • Automatic extraction of the ID3v1.x and ID3v2 tags(Author / title informations stored in the mp3 file)
  • Authors analysis to prevent from double recording
  • Tracks Edition - Deletion - Activation - Deactivation
  • Authors Creation - Edition - Deletion
  • Playlists Creation - Edition - Deletion
  • Automatic code generator for the FLAM Player integration in a page
  • Automatic page generator with the FLAM Player in

Installation

Requirements

For FLAM Player to work, you need :

  • Flash player v6 (for you and your listeners)
  • A WEB server (developed with Apache)
  • MySQL database
  • PHP v4.3.x (developed with 4.3.4)
  • A recent browser for the administration module (tested with IE5/6, NS6/7, OPERA7)
NOTES:
  • If you don't have PHP, nor MySQL
    Nevertheless, you can have FLAM Player on your site !
    Yes, it is possible thru the free service we are offering on www.flamplayer.com, you will able to embed FLAM Player in your pages without any requirement or installation.

Step by step installation

  • Create a new directory to host FLAM Player on your Web server
    (I will call it "FLAM_PLAYER_REP")
  • Create a new directory to store your mp3 files on your Web server
    (I will call it "MUSICS_REP")
  • Extract (with subdirectories) the FLAM Player zip in a temporary local directory
    (I will call it "LOCAL_TEMPO_REP")
  • Edit, with a basic text editor (like Notepad), the file LOCAL_TEMPO_REP/settings/fp_settings_1.php
  • Enter the settings to access to the database :
    Hostname / Database name / User / Password
  • Authentication is necessary to access to the administration module (default setting),
    enter a username / password (default "admin" / "admin")

    WARNING:
    This is a basic authentication process, see the section
    Known issues to know more, and to see how to improve the administration module security
  • Enter the default language for the administration module
    ("en" for English / "fr" for French)
  • You can change the name of the tables which are about to be created
  • Save the file and exit
  • Upload the LOCAL_TEMPO_REP content to FLAM_PLAYER_REP
  • Change permissions on the following files / directories to 777 (CHMOD) :
    FLAM_PLAYER_REP/settings/fp_settings_2.xml
    FLAM_PLAYER_REP/pages
    MUSICS_REP
  • Using your web browser visit the location : http://www.your_webserver.com/FLAM_PLAYER_REP/admin/fp_init.php
    and enter the user / password defined at step 6.
    When this page starts, the necessary tables are automatically created
  • Enter the whole HTTP link of your MUSICS_REP directory
  • The next parameters are not required, these are the default settings that will appear during the FLAM Player integration in a page

    NOTE:
    You can go back later to this page without risk if you have something to change
  • Save the settings
    Et voilà, FLAM Player is ready to be used, you can launch the administration module with
    http://www.your_webserver.com/FLAM_PLAYER_REP/admin/fp_admin.php

Step by step upgrade from version 1.0

  • Backup the file FLAM_PLAYER_REP/settings/fp_settings_1.php from FLAM Player's version 1.0
  • Replace all files of FLAM_PLAYER_REP (and sub-directories) by the ones of version 1.5
  • Put back your file FLAM_PLAYER_REP/settings/fp_settings_1.php
  • Change permissions on the following files / directories to 777 (CHMOD) :
    FLAM_PLAYER_REP/settings/fp_settings_2.xml
    FLAM_PLAYER_REP/pages
  • Using your web browser visit the location : http://www.your_webserver.com/FLAM_PLAYER_REP/admin/fp_init.php
    and login
  • Enter the whole HTTP link of your MUSICS_REP directory
  • The next parameters are not required, these are the default settings that will appear during the FLAM Player integration in a page

    NOTE:
    You can go back later to this page without risk if you have something to change
  • Save the settings
    Et voilà, FLAM Player is ready to be used, you can launch the administration module with
    http://www.your_webserver.com/FLAM_PLAYER_REP/admin/fp_admin.php

Add tracks

Upload MP3 file

This functionality is more a gadget than a serious transfer tool.
Technically, this is an HTTP file transfer, and so, there is some constraints that are set by the server.
Use this transfer mode only if you have small files or if you have a very large bandwidth.

Favor the use of a standard FTP client to upload your musics in the MUSICS_REP directory you defined.

NOTES:
  • Only the mp3 format is allowed.
  • A MUSICS_REP/temp directory is created when you try to upload a file that already exists, this directory is cleaned each time the administration module is launched, so, don't store anything inside !!!
  • A MUSICS_REP/upload_logs directory is created at the first file transfert, you can find the history of the transfers done using this module.

Integration - automatic tracks recording

When your musics are uploaded (whatever the method) in your MUSICS_REP directory, you must record them into the database, this is the purpose of this section.

The list you can see here in this module is the list of the tracks that are present in your MUSICS_REP directory and that have not been recorded yet. The already recorded tracks are hidden.

Select one or more files, assign them an existing playlist or enter a new one and press ok ... That's all !

For each selected track, the script extract the author / title informations that are stored in the mp3 file (ID3 Tag), then it analyses the author and check if it is an existing one or if it must be added and, finally, the track and its characteristics are stored in the databse.

The title choice is done according to this logic :

  • If the mp3 file contains an ID3v2 Tag, then store the title and the author from the ID3v2 Tag.
  • Else, if mp3 file contains an ID3v1.x Tag, then store the title and the author from the ID3v1.x Tag.
  • Else, store the filename as the title (without extension) and "Unknown / Inconnu" as the author.

NOTE:

External link additionmanual addition of an external mp3 link

Here, you can add any external HTTP link to a MP3 file.
Assign it an existing playlist or enter a new one and press ok.

NOTE:
  • The script can only handle ID3 v2 Tags for external links, the reason is that ID3 v1 tags are stored at the end of the mp3 file, so it would be necessary to load the complete mp3 file to extract title and author.

Edit tracks

The purpose of this module is the modification or the suppression of the tracks that are already recorded in the database.
Nothing special here, your track list is displayed, and you can change the title / author / playlist / enable-disable the track.

I know it is sometimes hard to find a track, so i have added a filter which provide different displays and classifying. Note that it is possible to launch FLAM Player with the current filter, the purpose of that is only to play some tracks if it is necessary.

There is two suppression modes in this module : "Delete records only" or "Delete mp3 files and records"
(If you choose "Delete records only", your mp3 files will be back in the Integration - automatic tracks recording module).

NOTES:
  • In this module, the edition is individual. I know that when you record a lot of mp3 files, they often don't have ID3 Tag, so you have a lot of track with "Unknown / Inconnu" as the author. To assign the right author to several tracks, favor the use of the change tracks authors module that is more handy for that case.
  • Active / Inactive allow you, you guess it, to display or not a track in the FLAM Player without the track to be necessarily deleted.
  • Of course, the "Delete mp3 files and records" mode don't erase external mp3 files, only your locals mp3 in MUSICS_REP are deteled.

Manage authors

Add - Edit - Delete authors

Nothing special here, i think all is evident.
Just note that you can't delete an author which is still linked to a track, the delete button is hidden

It is possible to enter, for each author, his Email and Website, they will be available through FLAM Player. This is ideal for communities that present the work of freelance artists.

Change tracks authors

This section provide an easy way to interchange the authors, for example to reassign the right authors to tracks that didn't have ID3 Tags (with " Unknown / Inconnu " as author). The benefit of this module is that it can handle multiple tracks in one action, avoiding an onerous individual edition.

Select the origin author, one or more tracks and the target author.

Manage playlists

Add - Delete playlists

This section is working like the previous section Add - Edit - Delete authors.
Just note that you can't delete a playlist which is still containing a track, the delete button is hidden.

Move playlists content

This section provide an easy way to move tracks from a playlist to another.

Select the origin playlist, one or more tracks and the destination playlist.

Integrate FLAM Player

Adjust FLAM Player's settings

That is probably the most important section of the administration module, that's where you define the FLAM Player's appearance and content before you integrate it in an HTML page.

The player's color :


Select a predefined color or enter the hexadecimal code of the color you wish to have.
If you don't know how to obtain the hexadecimal code of a specific color, you can use one of these excellent links :

  • http://www.colormatch.dk/
  • http://www.easyrgb.com/
  • http://www.pourpre.com/chromograf/index.html
  • You can customize the predefined colors, read the section Modifying predefined colors to know how to proceed.

    The player's background color :


    The FLAM Player shape is not a perfect square, so you will see the background color next to the rounded corners in your page. The generated code for the FLAM Player integration uses the Flash's transparent mode, but this option is not compatible with all browsers. To be sure, you can enter the background color of your future HTML page to hide these corners.

    Next options :


    The next options are simply the content adjustment, which language ? which playlist ? which order ?
    Take note that the filters are accumulative, so, if you select the playlist "mixes" and the author "DJFoo", FLAM Player will only display "DJFoo" tracks that are in the "mixes" playlist.

    Never go to the next step if the FLAM Player's preview is not exactly what you wish to have (The new code is generated each time you click on "update display").

    Integrate FLAM Player in a page

    At this step, the FLAM Player's preview should be exactly what you wish to integrate in your HTML page.

    To integrate FLAM Player, you have two ways :

    • Copy / paste the generated code where you want in your page.
    • Clic on "create a basic page with the player in", and then, an HTML page is generated in FLAM_PLAYER_REP/pages

    NOTES:
    • The genarated pages can be moved where you want, even on another website.
    • It is the same for the code, but don't forget that even if FLAM Player is integrated on another website, it will still be loaded from where it was generated.

    More technical details

    Global working process

    Working process diagram :


    What is interesting here is that FLAM Player's appearance and content are set by the variables which are in the page.
    If you are a developer, you could control FLAM Player dynamically.

    Here is an example of the code generated by the administration module :

    				
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    	codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
    	width="300" 
    	height="315">
    		<param name=movie value="http://www.yoursite.com/flamplayer/flam-player.swf">
    		
    <param name=flashVars value="fp_root_url=http://www.yoursite.com/flamplayer/&ovr_color=0x75855C&ovr_langage=en&ovr_playlist=default_playlist&ovr_author=all&ovr_order=name_artist&ovr_order_direction=ASC&ovr_autoplay=1&ovr_loop_playlist=1&ovr_loop_tracks=0&ovr_shuffle=0">
    <param name=menu value=false> <param name=quality value=best> <param name=wmode value=transparent> <param name=bgcolor value=#383838> <embed src="http://www.yoursite.com/flamplayer/flam-player.swf"
    flashVars="fp_root_url=http://www.yoursite.com/flamplayer/&ovr_color=0x999999&ovr_langage=en&ovr_playlist=default_playlist&ovr_author=all&ovr_order=name_artist&ovr_order_direction=ASC&ovr_autoplay=1&ovr_loop_playlist=1&ovr_loop_tracks=0&ovr_shuffle=0""
    menu=false quality=best wmode=transparent bgcolor=#383838 width="300" height="315" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed> </object>


    The two yellow lines are those who condition all.
    These two lines includent exactly the same informations, the syntax is quite different to ensure compatibility between different browsers.

    The flashVars parameter provide the way to inject variables in a Flash movie,
    Here is the variables for FLAM Player :

    fp_root_url inform the Flash movie about where FLAM Player was installed
    fp_root_url=http://www.yoursite.com/flamplayer/

    ovr_color inform the Flash movie about the requested player's color
    &ovr_color=0x999999

    ovr_langage inform the Flash movie about the requested player's language
    &ovr_langage=en

    ovr_playlist inform the Flash movie about the requested playlist
    &ovr_playlist=default_playlist

    ovr_author inform the Flash movie about the requested author
    &ovr_author=all

    ovr_order inform the Flash movie about the classifying criterion
    &ovr_order=name_artist

    ovr_order_direction inform the Flash movie about the classifying order direction
    &ovr_order_direction=ASC

    ovr_autoplay inform the Flash movie if the autoplay mode must be activated or not
    &ovr_autoplay=1

    ovr_loop_playlist inform the Flash movie if the Loop playlist mode must be activated or not
    &ovr_loop_playlist=1

    ovr_loop_tracks inform the Flash movie if the Loop tracks mode must be activated or not
    &ovr_loop_tracks=0

    ovr_shuffle inform the Flash movie if the shuffle mode must be activated or not
    &ovr_shuffle=0

    NOTE:
    • The background color is a standard parameter of Flash, it has nothing to do with FLAM Player variables,
      this is the "bgcolor" parameter.

    Modifying predefined colors

    To customize the predefined colors palette, edit the file FLAM_PLAYER_REP/settings/fp_settings_2.xml.
    The section identified by INDEX[9] is the 10 predefined color codes. Always in hexadecimal , always with the RRGGBB format and separated by commas.

    The 'flam_update_playlist' Function

    Since version 1.5, a function is available for the developers who want to dynamically create / update FLAM Player's playlists without using administration module. For example, if you already have a site with mp3 playlists and authors directories, you can easily import these datas into FLAM Player thru this function.

    How to ?

    1. Include in your PHP script the 3 following FLAM Player's scripts :

    • require_once('...YOUR_PATH.../FLAM_PLAYER_REP/includes/fp_admin_functions.php');
    • require_once('...YOUR_PATH.../FLAM_PLAYER_REP/includes/ez_sql.php');
    • require_once('...YOUR_PATH.../FLAM_PLAYER_REP/settings/fp_settings_1.php');

    2. Export your datas to a two-dimensional array which has the following structure :

    Array
    (
       [0] => Array
           (
               ["artist_name"] => artist 0 name
               ["artist_email"] => artist 0 email
               ["artist_website"] => artist 0 site
               ["music_title"] => track 0 title
               ["music_link"] => mp3 0 link
           )
    
       [1] => Array
           (
               ["artist_name"] => artist 1 name
               ["artist_email"] => artist 1 email
               ["artist_website"] => artist 1 site
               ["music_title"] => track 1 title
               ["music_link"] => mp3 1 link
           )
    
    
        ( ... )
    
    
       [n] => Array
           (
               ["artist_name"] => artist n name
               ["artist_email"] => artist n email
               ["artist_website"] => artist n site
               ["music_title"] => track n title
               ["music_link"] => mp3 n link
           }
    }
    			

    3. Call the function like below :

    • flam_update_playlist ( "Name of the playlist to create or update", $Name_of_the_array_previously_created );
    NOTES:
    • WARNING : This function is a full update function for the concerned playlist, it adds news tracks, update modified tracks and DELETE tracks that wasn't provided by the new listing ! So don't use it to add a track to the existing content, export your full playlist each time it is updated.
    • WARNING : Don't use space nor exotics characters for the playlist name, otherwise it will be renamed to fit standard.
    • You can find an example in FLAM_PLAYER_REP / admin / fp_update_playlist_example.php
      Note that the function call is disable with comments for security reasons.
    • About mp3 links, all the links without "http://..." will be considered as local files stored in MUSIQUES_REP.
    • ID3 tags are not extracted during this update, so if you don't provide any author or title, the default titles will be the filename without the .mp3 extension.
    • Of course, the demo links don't exists in reality, so if you can't ear anything with the player, that's normal :) .

    Known issues

    • The authentication process is very basic.
      If you have precious datas and if you want to improve security, perhaps you should use something like .htaccess.
      If you choose that, you can disable the basic authentication process with the edition of FLAM_PLAYER_REP/settings/fp_settings_1.php.
      Change the line : $login_enable = "yes"; to $login_enable = "no";
    • have tested the insertion in the database of 200 mp3 files in one time, in one playlist.
      The script is freezing with a such amount of files, probably because of the form POST size. So, if you have a lot of mp3 to record in one time, proceed with paquets of maximum 30 files.
    • Sounds Play Too Fast and Sound like "the Chipmunks"
      This occurs if you are attempting stream audio that does not comply with the allowable sampling rates. Make sure that your audio complies with the sampling rates allowed by Flash streaming audio, which are: 44.1, 22 and 11kHz. These numbers refer to the number of samples per second, not to be confused with the bitrate (which is measured in Kbps, e.g., commonly seen as 128 KB).

    Credits

    Licence

    Copyright (C) 2005 DualBase Design s.e.n.c.
    
    FLAM Player is not Open Source, FLA and PHP source codes are copyrighted and cannot be sold
    
    YOU CAN :
    - Install FLAM Player where you want, for personal or commercial use
      (The FLAM Player footer with links must stay visible)
    
    YOU CANNOT :
    - Sell FLAM Player or any portion of it, as a product or a service
    
    - Copy / Modify / Rename / Decompile SWF / Redistribute FLAM Player's files wihout
      prior authorisation of Dualbase s.e.n.c.
    
    - Use FLAM Player to broadcast illegal MP3 files
    
    ----------------------------------------------------------------
    NO WARRANTY
    
        BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
    FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
    OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
    PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
    OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
    TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
    PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
    REPAIR OR CORRECTION.
    
        IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
    WILL ANY COPYRIGHT HOLDER BE LIABLE TO YOU FOR DAMAGES,
    INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
    OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
    TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
    YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
    PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
    POSSIBILITY OF SUCH DAMAGES.