Export (0) Print
Expand All

4.7 Streaming and Stopping Playback by Using Non-Pipelined Mode

The sequence described in this topic occurs between a client and server while streaming a file, pausing playback, and then resuming playback using the non-pipelined mode of the protocol.

For more information about the packet types, see section 2.2.2.3.

  1. The client sends a Describe request to retrieve the ASF header.

  2. The server responds with a $H (Header) packet.

  3. The client sends a Play request for the file, selecting one or more streams.

  4. The server responds with a $H (Header) packet and $D (Data) packets. The number and size of the $D (Data) packets are not necessarily known at the time of the Play request, so it is not possible for the server to send a Content-Length header. The server transmits $D (Data) packets for the stream until the TCP connection is closed.

  5. The client stops streaming by terminating the TCP connection.

  6. The client sends a KeepAlive request to the server.

  7. The client sends a Log request to the server.

  8. The server responds with a confirmation that it received the log.

  9. The client sends a Play request for the same file, specifying the point or offset from which to resume playback. If an offset is not specified, the client resumes playback from the beginning of the file.

  10. The server responds with a $H (Header) packet and $D (Data) packets.

  11. After all data packets have been sent to the client, the server sends a $E (End-of-Stream Notification) packet to indicate that the end of the ASF file has been reached.

  12. The client sends a Log request to the server.

  13. The server responds with a confirmation that it received the log.

Pause is implemented by the client terminating the existing TCP connection and issuing another Play request after playback has stopped. In the Play request, the client can specify the point or offset from which to resume playback by using the stream-offset token on a Pragma header. The client can use packet-num, stream-time, or the stream-offset tokens on a Pragma header to specify the offset. These headers are used to seek to a specific point within the ASF file that the client was streaming. If the offset is not provided, then the client resumes playback from the beginning of the file. The server responds to the Play request as described in step 4.

The following figure shows the previously described sequence.

c86309ef-58bb-4fc7-9aea-7c11df298e4f

Figure 10: Stream, pause, and resume packet sequencing

 
Show:
© 2014 Microsoft