• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

5.2. Stream Names

There is no stream name management system directly available in either client- or Server-Side ActionScript, though some stream management features are available through the server management application programming interface (API) as described in Chapter 10. When a movie connects to an application instance, there is no built-in way for the movie to discover what live streams may be available, what stream names it can use to publish without conflicting with another movie's stream names, and what recorded streams are available for playback. Instead, each application is responsible for managing its own streams. This may sound like a drawback, but FlashCom provides resources that give developers the flexibility to design applications with a wide variety of behaviors. When applications must provide the names of the live streams currently being published, a shared object is often used. As streams are published, the name of each stream is added to the shared object. When a published stream is closed or the publishing movie disconnects, the stream name is removed from the shared object. Collisions between stream names are often avoided by centralizing stream naming within the application instance or by allocating a unique name to each client. For example, a stream name can be based on a user's unique username or ID number. Alternately, a unique stream name, based on some other scheme such as a sequence number, can be requested from the application via a remote method call.

You can run into two related problems when stream names collide. With live streams, if two movies attempt to publish streams with the same URI, the first stream will succeed and the second will fail. Recorded streams add the possibility that streams will be unintentionally overwritten or deleted. Here are a few ways to allocate relative URIs to streams to avoid name conflicts:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint