Record Message in a Gong board

Subject:

The Relevant JavaScript and HTML Code

This example is created using a Gong applet with a few HTML components. The Gong applet is hidden visually in the page but it remains working in the background.

There are three buttons on this webpage. Pressing the 'Record' button will start the recording of a new voice message. To stop the recording and post the message the user is required to press the 'Stop' button. The recording is started by calling a function called 'gongRecord' in the 'gong.js' library. When the recording is finished two other functions 'gongStop' and 'gongPostMessage' are used to put the voice message in the board.

To playback the recorded message the user can press the 'Play' button.

...
<script type="text/javascript" src="gong.js"></script>
<script type="text/javascript">
<!--
    function record() {
        ...
        gongRecord(document.getElementById("applet"));
        ...
    }

    function stop() {
        ...
        gongStop(document.getElementById("applet"));
        gongPostMessage(document.getElementById("applet"),
                        null,
                        "GongAPI",
                        document.getElementById("subject").value);
        ...
    }
// -->
</script>
...
<input type="text" id="subject" />
...
<input type="button" value="Record" onclick="record()" />
<input type="button" value="Stop" onclick="stop()" />
...
<applet id="applet" ...>...</applet>
...