Note: This example demonstrates the basics of a video chat application. It's provided as a starting point or reference for developers, not as a production-ready chat system.
Configuring the videochat application and source files
This tutorial uses a web server to make the VideoChat webpage files accessible to both client computers. If you don't want to use a web server, you can copy the contents of the FlashRTMPPlayer folder to a network share or place a copy on each client.
To configure the sample videochat application:
- On the computer running the Wowza media server, navigate to [install-dir]/examples/VideoChat and then click install.bat. This installs a live application named videochat.
Note: The videochat application comes with low-latency streaming enabled as this is beneficial for chat applications. For more information on low-latency applications, see How to achieve the lowest latency from capture to playback.
- Copy the files in [install-dir]/examples/VideoChat/FlashRTMPPlayer to your web server. For this example, place the four files and two folders in a folder in the web root named VideoChat.
Testing videochat playback
The example player.html webpage contains embedded video players that can connect to and preview a computer's webcam feed, stream that video to the Wowza media server, and playback a stream from the media server. Navigate to this webpage on two remote client computers (Computer1 and Computer2) to test the videochat application.
To test the videochat application on two client computers:
- In an Internet browser, navigate to http://[your-web-server]/VideoChat/player.html to open the VideoChat player you moved to your web server.
- If your Wowza media server is on a different computer than Computer 1 or Computer 2, change the Server value on that client to rtmp://[wowza-ip-address]/videochat (where [wowza-ip-address] is the IP address or hostname of the Wowza media server).
- Click Connect. In the Adobe Flash Player Settings dialog box, click Allow to give Adobe Flash Player access to your webcam and microphone. When Flash Player has access, video from your webcam will be displayed in the Sender video section on the left side of the webpage.
- Enter a Stream Name under the Sender video section on each client. The client computers connect to different streams within the same application so make the two names unique. For example:
Computer1 Stream Name: Computer1Stream
Computer2 Stream Name: Computer2Stream
- Click Publish next to the Sender Stream Name on each client. The videochat application is now receiving webcam video from both client computers and can make them available for streaming to video chat participants.
- On each client computer, enter the Stream Name for the opposite client stream in the Receiver video section on the right side of the example webpage. In this example, Computer1 will receive Computer2Stream and Computer2 will receive Computer1Stream.
- Click Play next to the Receiver Stream Name on each client.
- You can configure one client computer to both send and receive the same stream. In this case, you can open [install-dir]/examples/VideoChat/FlashRTMPPlayer/player.html directly and then enter the same Stream Name underneath the Sender and Receiver video sections in the example webpage.
- If your client computers are in the same location, you might need to mute the microphone on one of the computers to prevent audio feedback.
Originally Published: 10-01-2010.
Updated: For Wowza Streaming Engine on 02-11-2014.
If you're having problems or want to discuss this article, post in our forum.