title: When generating an M3U8 HLS playlist, should I include media segments which don't exist yet?
body: <p>I am generating m3u8 <em>media playlists</em> for HLS <a href="https://www.rfc-editor.org/rfc/rfc8216" rel="nofollow noreferrer">https://www.rfc-editor.org/rfc/rfc8216</a></p>
  <p>Should I include each media segment URL (for an MPEG-2 transport stream file) in the media playlist before data becomes available at that URLs? Or should I only include video segments which have finished recording and once I know the data is ready to download, and wait for the HLS client to re-request the playlist?</p>
  <p>I feel like that standard isn't very clear on this point.</p>
  <p>I note that for at least one HLS client (HLS.js), it requires at least one media segment to exist in the media playlist, otherwise it has a tizzy. It's possible this is just a bug, of course.</p>
  <p>As a bit of background, the media segments in my playlist are Amazon S3 URLs. I instruct a different machine to start uploading the video segments to S3 when I receive a request for a playlist.</p>