Skip to main content
Participant
October 9, 2007
Answered

Virtual Directory Problem

  • October 9, 2007
  • 1 reply
  • 220 views
Any help would be greatly appreciated.

I am new to Flash, and I'm new to Flash Media Server. I am trying to get FMS to look at a virtual directory. I have set up this simple Application.XML file:

<Application>
<!-- This section contains information about configuring the script engine. -->
<JSEngine>
<FileObject>
<VirtualDirectory>/mi05;c:\temp\</VirtualDirectory>
</FileObject>
</JSEngine>
</Application>


I have this code in the .ASC file:
application.onConnect = function(user) {
application.acceptConnection(user);
Client.prototype.songPlay = function(songsNow, v2) {
this.songStream = Stream.get("songs");
this.songStream.play("mp3:song4", 0);
trace("Playing MI01");
};
Client.prototype.stopPlay = function() {
this.songStream.play(false);
trace("All play has stopped.");
};
};


I have song4.mp3 in C:\temp. I know the code is working because I'm getting the trace messages in FMS. However, I'm not hearing anything. What am I doing wrong?


--Mike
    This topic has been closed for replies.
    Correct answer Mike_Burger
    I self-diagnosed the issue. I'm using VirtualDirectory inside the default vhost.xml instead of application.xml. You also need to have the virtual directory declared in the filename instead of the connection:

    this.songStream.play("mp3:mi05/song4", 0);

    I hope this helps someone in the future.

    1 reply

    Mike_BurgerAuthorCorrect answer
    Participant
    October 10, 2007
    I self-diagnosed the issue. I'm using VirtualDirectory inside the default vhost.xml instead of application.xml. You also need to have the virtual directory declared in the filename instead of the connection:

    this.songStream.play("mp3:mi05/song4", 0);

    I hope this helps someone in the future.