Menu

#10 Flash applet doesn't work?

open
nobody
None
6
2010-11-04
2010-11-04
Sven Geier
No

On my work computer, I run Slackware 13.1 (up-to-date via slackpkg). I run mpd and relaxx. I use my laptop to connect to it and I can play music and in particular I can right-click a file and select "play in browser" and it brings up the little flash applet and lets me play the music locally. Cool.

At home, I ALSO run Slack 13.1, also up-to-date. I run the same version of mpd and the same version of relaxx (0.7.0 is what it says in the lower right corrner) and I use the same browser (Firefox) on the exact same laptop that I also use at work. I can play songs on my speakers and all and everything appears to work fine BUT: when I right-click a song to "play in browser", a small window opens that says "Macromedia Flash Needed". This is the same identical browser on the same identical laptop that I also use at work so I'm sure there's no difference in my local setup - but there must be some kind of probing going on where relaxx tests whether it can recognize (my local) Flash and somehow that appears to go wrong on my home machine but not at my work machine.

Discussion

  • Sven Geier

    Sven Geier - 2010-11-04
    • priority: 5 --> 6
     
  • Sven Geier

    Sven Geier - 2010-11-04

    I "kinda" got it working. There are at least three different pieces of junk in ..plugins/audioplayer/plugin.php:

    1) At three different locations, it uses short_open_tags - which is not in the least understood to be interpreted as "PHP" by every web server. Maybe the author of the code runs PHP and only PHP, but in general "<?" is meaningless.

    As the /etc/httpd/php.ini states:
    ; NOTE: Using short tags should be avoided when developing applications or
    ; libraries that are meant for redistribution, or deployment on PHP
    ; servers which are not under your control, because short tags may not
    ; be supported on the target server. For portable, redistributable code,
    ; be sure not to use short tags.

    Fix: replace three instances of "<?" with "<?php"

    2) There is a reference in there to
    $path = $HTTP_SERVER_VARS['HTTP_REFERER']

    ... which returns empty. I don't know why, but after appending '/music/' to it a few lines farther down, this always comes out to $path = '/music/...' which will work ONLY if relaxx is the only thing running on that web server IN the web-root.

    If the server admin does something sensible like "http://server.name/relaxx/" then the 'music' softlink will not be in '/music...' but in '/relaxx/music/...'.

    Fix: I don't know a thing about PHP, but the following kludge works for me:
    Remove the lines that say

    $path = $HTTP_SERVER_VARS['HTTP_REFERER'];
    $path = substr($path,0, strrpos($path,"/"));

    and replace with

    $path = '/relaxx';

    and suddenly the music is found. However this is NOT a fix, since it now relies on relaxx to be in a certain specific subdirectory (instead of relying on it being in the server root).

    3) Either PHP or swf barfs on filenames with commas or ampersands in them. A song that can be played just fine in relaxx itself (i.e. through mpd, i.e. mpd can find and open it just fine) can NOT be played in the browser if the filename contains a charater like ",", "[", "&" etc.

    [10:46] Lizard [penguin:plugins/audioplayer] > ls /home/Home/My\ Music/Antonin\ Dvorak/Dvorak\ in\ Prague/*.mp3
    01_Carnival_Overture,_Op._92.mp3
    02_Romance_in_F_minor_for_Violin_&_Orchestra,_Op._11.mp3
    03_Klid_[Silent_Woods._for_Cello_&_Orchestra,_Op._68,_#5.mp3
    04_Humoresque_in_G-flat_Major,_Op._101,_#7.mp3
    05_O_Moon_High_up_in_the_Deep_Sky.mp3

    ...

    By sheer accident, file number 5 in that list can be played in my browser, the others cannot - even though they all can be playlisted and played on the server through mpd/relaxx. Someone might want to tweak something there somewhere.

     

Log in to post a comment.

MongoDB Logo MongoDB