title: Get duration of an HTML5 video (live stream)
body: <p>I'm looking at options to switch from flash (strobe) to HTML5 solution (using Media Source Extensions with DASH or HLS).
  According to the HTML5 specs for video we can't get the duration of a live stream video. </p>
  
  <blockquote>
    <p>The duration attribute must return the time of the end of the media resource,
    in seconds, on the media timeline. If no media data is available, then the
    attributes must return the Not-a-Number (NaN) value. If the media resource is
    known to be unbounded (e.g. a streaming radio), then the attribute must return
    the positive Infinity value.</p>
  </blockquote>
  
  <p>My live stream is not a "sliding window" meaning that we have a fixed start date. I am currently using Strobe player and it actually increase the duration as it plays whereas HTML5 always returns <code>Infinity</code>.</p>
  
  <p>I wanted to know if some options are available to maintain myself a duration (by parsing fragments for example, this <a href="https://github.com/RReverser/mpegts" rel="nofollow">library</a> does that in a way). </p>