Hello everyone, this is my first post, if I am posting on the wrong place, please forgive me.

If possible could anyone give me some pointers, advice or help to the problem that I am having in streaming MP3 using Flash Media Server.
My problem is, instead of streaming audio files from Flash Media Server using the code bellow I have created, it only plays audio (mp3) and doesn't stream, and doesn't display the audio length in flowplayer...
I really would appreciate if you could help me with this.

I am using
Drupla -> 6.14
SWFTools module -> 6.x-2.5
Flowplayer -> 3.1.5
Flowplayer rtmp plugin ->3.1.3
Flash Media Server -> 3.5.1

I assume the solution is this one that can be found on this website http://flowplayer.org/plugins/streaming/rtmp.html, but I still haven't manage to make it work.

1. Taken from this site http://flowplayer.org/plugins/streaming/rtmp.html I add the function to get the file size into main.asc (FMS)

My Flash Media Server main.asc file:

application.onConnect = function( client ) { 
    client.getStreamLength = function( streamName ) { 
        trace("length is " + Stream.length( streamName )); 
        return Stream.length( streamName ); 
    } 
    application.acceptConnection( client ); 
}

2. I assume I need to call the function bellow and insert it into my node-audio-tpl-php file, but I don't now in each variable of flowplayer I should add, I have tried to add to flashvar, etc... without any success.

Code taken from http://flowplayer.org/plugins/streaming/rtmp.html.

// make the rtmp plugin query the stream length from the server 
durationFunc: 'getStreamLength' 

code from my node-audio.tpl.php to display the flowplayer that streams mp3 audio files

<div class="audioplayer span-16">
            <?php
            //MP3, MP4

            $server_documents_path='audio' . '/';
            $path_parts = pathinfo($node->field_audio_file[0]['filename']);

            //get image from image attach by id
            $node2 = node_load(array('nid'=> intval($node->iids[0])));
            $path_parts_image= pathinfo($node2->images['preview']);

            if ($path_parts['extension']=='mp4' || $path_parts['extension']=='mp3') {
                $filename_stream=$path_parts['extension'] . ':';
            }else {
                $filename_stream='';
            }

            print swf($filename_stream . $server_documents_path . $path_parts['filename'],
                array(
                'flashvars' => array('type' => 'rtmp'),
                'othervars' => array(
                'stream' => 'rtmp://192.168.1.43/vod/',
                'methods' => array('action' => 'swftools_flv_display'),
                'image' => 'images/' . $path_parts_image['basename']
                ),
                )
            );
            ?>
        </div><!-- End audio player -->

Thanks in advance

Claudio Fernandes

Edited by WorldFallz - moved to appropriate forum.

My quick fix:
http://drupal.org/node/663526