Multipoint publishing allows clients to publish to servers with only one client-to-server connection. This feature enables you to build large-scale live broadcasting applications, even with servers or subscribers in different geographic locations.
Using multipoint publishing to publish content from server to server, even across geographic boundaries
A. Live Video B. Server 1 (New York City) C. Server 2 (Chicago) and Server 3 (Los Angeles) D. Users
The application flow that corresponds to this illustration works like this:
- A client connects to an application on Server 1 in New York City and starts publishing a live stream.
- The application on Server 1 receives an application.onPublish event, which it handles in its main.asc file.
- The application creates two NetStream objects in its onPublish event handler to stream to Server 2 (Chicago) and Server 3 (Los Angeles).
- Server 1 rebroadcasts the live stream to Server 2 and Server 3 with a NetStream.publish() method.
- Subscribers connecting to Server 2 and Server 3 receive the same live stream.
- The application receives an application.onUnpublish event when the client stops publishing.
To use multipoint publishing, you need to write server-side code in a main.asc file.