4.10 Stream Selection
The SelectStream request is sent by the client to notify the server which streams it requests. If a file contains only one stream, the SelectStream request will request that the server send the default streams for that file. A SelectStream request will always accompany a Play request to denote which audio and/or video streams the client wants to play based on preferences and bandwidth considerations. As with Log and KeepAlive requests, SelectStream request can be sent multiple times during a session, and they are always sent as a POST request on a separate TCP connection.
The following scenarios are examples of when a SelectStream request would be sent by the client:
-
When streaming a server-side playlist, the client will send a SelectStream request between each playlist entry.
-
When streaming a multi-language Windows Media Audio (.wma) file, the client will send a SelectStream request whenever the client changes from one language to another.
-
When streaming a multiple bit rate ASF file, the client will send a SelectStream request whenever it experiences a prolonged change in bandwidth conditions.
The sequencing applies to both the pipelined and the non-pipelined mode of the protocol:
-
The client sends a Describe request to retrieve the ASF header.
-
The server responds with a $H (Header) packet.
-
The client sends a Play request for the file, selecting one or more streams.
-
The server responds with a $H (Header) packet and $D (Data) packets.
-
To change streams, the client passes the stream selection information using a SelectStream request with the stream-switch-entry token on a Pragma header.
-
The server responds by acknowledging the client request and switching to the requested stream.
Note To avoid disruptions in a video stream, the server will switch the streams at a key frame.
-
The client detects the stream change in the data stream and renders the new stream.
Note The client will not send a message to the server as a result of this stream change.
The following figure shows the previously described sequence.
Figure 13: Using the SelectStream Request packet sequencing