4.5.2 Server-Side Playlist Streaming with Predictive Stream Selection

The following sequence occurs between a client and server during a server-side playlist switch using either the pipelined mode or the non-pipelined mode of the protocol.

For more information about streaming server-side playlist without predictive streaming, see section 4.5.

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

  2. The server responds with "Supported: com.microsoft.wm.predstrm".

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

  4. The server responds with a $H (Header) packet and $D (Data) packets of the first playlist entry.

  5. The server sends a playlist change signal to the client by sending a $C (Stream Change Notification) packet.

  6. The client sends a Log request for the previous entry in the playlist.

    Note When the pipelined mode of the protocol is used, the client sends the Log request over the same TCP connection that was created with the client's initial GET request. The response to the POST request is not returned until the previous GET request is terminated by the server.

    Note When the non-pipelined mode of the protocol is used, the client sends the Log request over a new TCP connection. This request contains the client identifier in the client-id token on the Pragma header so that the server can associate the log with the client.

  7. The server predicts the stream selection for the next playlist entry and immediately starts sending $H (Header) and $D (Data) packets for the next entry.

    The client starts receiving the data for the next entry while it is rendering the data for the previous entry. By the time the client finishes rendering, it has accumulated enough data for the next entry to make a seamless switch.

  8. If the client wants to override the streams selected by the server, the client sends a GET request to start streaming a new entry.

    Note When the pipelined mode of the protocol is used, the client sends a PlayNextEntry request with the xPlayNextEntry token on the Pragma header over the same connection to the server. This request also contains the stream-switch-entry token on the Pragma header for the next entry, which would override the server prediction of streams. The xPlayNextEntry token indicates that the client can continue streaming the data for the next entry. If the client is lagging behind the server, it can send a client-lag token on a Pragma header with a value specified in milliseconds. Upon receipt, the server would pause the predictive stream selection for the smallest time amount specified by the client-lag token and 15000 milliseconds.

    Note When the non-pipelined mode of the protocol is used, the client sends a SelectStream request. This request contains the stream-switch-entry token on a Pragma header that specifies the next entry for which the server sends data packets.

  9. The server terminates the Play request for the previous entry in the playlist, as described in step 3.

  10. The server sends the response for the Log request, as described in step 6.

  11. The server sends the response for the GET request for the new entry, as described in step 8.

  12. The server sends $D (Data) packets for the next entry.

The following figure shows the sequence described.

Sequencing during playlist streaming with predictive stream selection

Figure 8: Sequencing during playlist streaming with predictive stream selection

The following example shows a Log request.

 POST /simple.wsx?WMCache=0 HTTP/1.1
 Accept: */*
 User-Agent: NSPlayer/9.0.0.2833
 Host: SampleServer
 X-Accept-Authentication: Negotiate, NTLM, Digest
 Pragma: client-id=2380927133
 Content-Length: 3012
 Content-Type: application/x-wms-LogStats;charset=UTF-8
  
  

The following example shows a PlayNextEntry request.

 GET /simple.wsx?WMCache=0 HTTP/1.1
 Accept: */*
 User-Agent: NSPlayer/9.0.0.2833
 Host: SampleServer
 X-Accept-Authentication: Negotiate, NTLM, Digest
 Pragma: client-id=2380927133
 Pragma: xPlayNextEntry=1
 Pragma: no-cache,rate=1.000
 Pragma: client-lag=0
 Supported: com.microsoft.wm.srvppair, com.microsoft.wm.sswitch, 
            com.microsoft.wm.predstrm
 Accept-Language: en-us, *;q=0.1
 Pragma: stream-switch-count=4
 Pragma: stream-switch-entry=ffff:1:0 ffff:2:2 ffff:4:2 ffff:5:0