EnhancedXSPF with another player

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
rodolfo

EnhancedXSPF with another player

Post by rodolfo »

Is it possible to use the EnhancedXSPF module with another player?
Is it possible to add parameters to pass to the player?
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm
Location: the Netherlands

Re: EnhancedXSPF with another player

Post by Dee »

That shouldn't be too much of an issue. You can set any player URL from the module preferences.
Parameters can be added in EnhancedXSPF.module.php at the end of the file in the function getExtraParameters().

Regards,
D
rodolfo

Re: EnhancedXSPF with another player

Post by rodolfo »

I tried to use another player (http://www.enricolai.com), but I get an error on reading the playlist. I thought that it could be because of the different parameters that the various players use, therefore I asked about adding new parameters.
Do you mean it's only a matter of adding the missing parameters?
Have you tried your module with other players?
Thank you.
R.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: EnhancedXSPF with another player

Post by Nullig »

@rodolfo

If you get this to work, can you please post your solution - I'd love to use this player instead of the default one.

Thanks,
Nullig
rodolfo

Re: EnhancedXSPF with another player

Post by rodolfo »

This is how I got it working:

1. Create a directory somewhere under the root of your cmsms site; e.g. I created the directory /var/www/mysite/modules/EnhancedXSPF/xspf/MyPlayer/

2. Download the files XSPF.swf and FMP3.swf from http://www.enricolai.com and copy them into the newly created directory

3. Edit the EnhancedXSPF.module.php file (make a backup copy first if you want) and add the following at the end of the getExtraParameters() function (I think it's the minimum set of parameters to get it working):

function getExtraParameters()
        {
                // non-preference parameters
                return array(
                        'alpha',
                        'alphabetize',
                        ...
                        ...
                        'volume_level',
                        'folder',
                        'display
'
                );
        }

4. Edit the templates/default.tpl template (make a backup copy first) and change the following

        {if $count_downloads == '0'}
                {assign var='url_begin' value="$player_url?playlist_url=$playlist_url%3Fplaylist=$playlist_id%26count_downloads=0"}
        {else}
                {assign var='url_begin' value="$player_url?playlist_url=$playlist_url%3Fplaylist=$playlist_id"}
        {/if}

to

        {if $count_downloads == '0'}
                {assign var='url_begin' value="$player_url?playlist=$playlist_url%3Fplaylist=$playlist_id%26count_downloads=0"}
        {else}
                {assign var='url_begin' value="$player_url?playlist=$playlist_url%3Fplaylist=$playlist_id"}
        {/if}

5. Eventually reassign (chown/chmod) the original ownership and permissions to the modified files.

6. Now go to your CMSMS admin interface and select "Extensions-EnhancedXSPF" from the menu, then select the "Module Preferences" tab. Edit the extended_player_url parameter and set it to:

http://my-host-ip/mysite/modules/Enhanc ... r/XSPF.swf

If you want to add the parameters to the Module Preferences form, you will have to edit the SetParameters() function instead of getExtraParameters() in the EnhancedXSPF.module.php file, and add the extra parameters there. Then you have to edit the action.admin_prefs.php to insert the input fields. This is something I haven't tryed yet.

7. To use your player you must now add a tag in a page, e.g.

{cms_module module="EnhancedXSPF" playlist="1" folder="http://my-host-ip/mysite/modules/Enhanc ... /MyPlayer/" display="1@. - @0@ - @"}

The "folder" parameter tells the XSPF player where to find the actual FMP3 mp3 player.
The "display" parameter tells XSPF player how to display the titles (you can read about the use of the parameters in http://www.enricolai.com/FMP3/XSPF-flash-mp3-player.asp).
There is still an "undefined" title at the top of the playlist that I hadn't the time to adjust; I think it's a matter of display parameter settings.
Because you change the template, changing to the original player involves some editing or some file name changing and is not parametric, but DeeEye, the developer of EnhancedXSPF, who I thank for his support, will eventually work on the module to add the missing flexibility.

NOTES:
The following happens to me also if I use the original 'embedded' player (EnhancedXSPF player):
A. Setting (checking) parameters no_direct_downloads or count_downloads in the EnhancedXSPF module makes the playback of *some* files fail (only some of the files of the playlist).
B. The playback *speed* of some files (I suspect they are the same files mentioned in A., but I could not get the proof) is slowed down; they are normal mp3 files, some are converted from CD's, some are original mp3's. Playing them in Windows (e.g. Windows Media Player) or Linux (e.g. Rhythmbox) is ok.

Please tell me if anyone experiences a similar behaviour or find a cause or solution... or if the above is not working.

R.
Locked

Return to “Modules/Add-Ons”