title: HTTP Live Streaming for IPhone
body: <p>I'm folowing Apple's proposal in <a href="https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-01" rel="nofollow noreferrer">https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-01</a>.
  Trying a dummy HTTP Live Streaming to my iphone, I wrote a webservice with Django corresponding to a .m3u8 file. I'm begining the response with</p>
  <pre><code>#EXTM3U
  #EXT-X-TARGETDURATION:#10
  #EXT-X-MEDIA-SEQUENCE:#0
  </code></pre>
  <p>I then write the URLs of the segments (6 segments of 10 seconds each )inside the response:</p>
  <pre><code>#EXTINF:10,
  http://...../sample_low-1.ts
  ...
  </code></pre>
  <p>and that's all. I change the part containing URLs of segments every minute, so in theory I'm expecting a continuous live stream.</p>
  <p>However, when I check the stream with my iphone I observe the following:</p>
  <p>The phone connects to ...m3u8 , gets its contents, starts downloading .ts files and starts showing the video. Then, after downloading 6th segment(last segment in the .m3u8) it reaches end of file, sees no</p>
  <pre><code>EXT-X-ENDLIST
  </code></pre>
  <p>and searches for the new .m3u8. The new .m3u8 is ready at the server at this point, as I renew the contents of .m3u8 every 60 seconds.</p>
  <p>However, the phone pauses, and I cannot achieve a continuous stream on the phone.</p>
  <p>So, obviously I make a huge mistake somewhere. Any helps and suggestions are very welcome.</p>
  <p>Edit : Turns out that incrementing media sequence works.</p>