Results 1 to 7 of 7

Thread: How to Save the Client Side Chat Message in Wowza?

  1. #1

    Default How to Save the Client Side Chat Message in Wowza?

    Hi
    I'm new to wowza.i Created a Text Chat using Wowza Examples.Its Working Fine.Now I want to Save the Chat message. That Client Side code is in Action Script File( Adobe Flash)
    can somebody explain me how can I Save the text chat message?

  2. #2

    Default

    Hi nathiya,

    You can edit the TextChat module or create a new one using it as a reference. The source is found in [Wowza-Install-Dir]/examples/TextChat/src.

    To get the username and chat message, add the following line, after "chatData" is initialized:
    Code:
    getLogger().info("User: " + chatData.getString("user") + " Message: " + chatData.getString("message"));

  3. #3

    Default

    Thank You i Got it

  4. #4

    Default

    Hi
    by using above code i could able to get user name and message but how to save that as a text file in wowza server. any guidence?

  5. #5
    Join Date
    Dec 2007
    Posts
    25,672

    Default

    It is being saved to the access log, which is a text file.

    You can also use the java.io.file api to write to a file.

    Richard

  6. #6

    Default

    Hi Richard,
    i have used file api and could able to create text file but i could save only last entered text in to the file. Here is a code i have tried

    public void onConnect(IClient client, RequestFunction function,AMFDataList params )
    {
    textfile = new File(client.getAppInstance().getStreamStoragePath( )+"textchat.txt");

    }

    public void addMessage(IClient client, RequestFunction function, AMFDataList params)
    {
    String soName = params.getString(PARAM1);
    AMFDataObj chatData = params.getObject(PARAM2);
    String msgtosave = "User: " + chatData.getString("user") + " Message: " + chatData.getString("message");
    try {
    output = new BufferedWriter(new FileWriter(textfile));
    output.write(msgtosave);
    output.close();
    } catch (IOException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
    }
    }
    how to save all chat messages. i have tried to create array but that is not working. any idea?

  7. #7

    Default

    Quote Originally Posted by malarprathap View Post
    Hi Richard,
    i have used file api and could able to create text file but i could save only last entered text in to the file. Here is a code i have tried

    public void onConnect(IClient client, RequestFunction function,AMFDataList params )
    {
    textfile = new File(client.getAppInstance().getStreamStoragePath( )+"textchat.txt");

    }

    public void addMessage(IClient client, RequestFunction function, AMFDataList params)
    {
    String soName = params.getString(PARAM1);
    AMFDataObj chatData = params.getObject(PARAM2);
    String msgtosave = "User: " + chatData.getString("user") + " Message: " + chatData.getString("message");
    try {
    output = new BufferedWriter(new FileWriter(textfile));
    output.write(msgtosave);
    output.close();
    } catch (IOException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
    }
    }
    how to save all chat messages. i have tried to create array but that is not working. any idea?



    i have got it to work. i just use output = new BufferedWriter(new FileWriter(textfile,true)); and it works great

    thanks for your support.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •