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?
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?
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"));
Thank You i Got it
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?
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
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?