<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - CurrentTime on mediaController is set as 0 when playback is completed."
   href="https://bugs.webkit.org/show_bug.cgi?id=149154#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - CurrentTime on mediaController is set as 0 when playback is completed."
   href="https://bugs.webkit.org/show_bug.cgi?id=149154">bug 149154</a>
              from <span class="vcard"><a class="email" href="mailto:eric.carlson&#64;apple.com" title="Eric Carlson &lt;eric.carlson&#64;apple.com&gt;"> <span class="fn">Eric Carlson</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=261294&amp;action=diff" name="attach_261294" title="Patch">attachment 261294</a> <a href="attachment.cgi?id=261294&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=261294&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=261294&amp;action=review</a>

<span class="quote">&gt; Source/WebCore/html/MediaController.cpp:458
&gt;      case ENDED:
&gt;          eventName = eventNames().endedEvent;
&gt; +        m_resetCurrentTimeInNextPlay = true;
&gt;          m_clock-&gt;stop();
&gt; -        m_clock-&gt;setCurrentTime(0);
&gt;          m_timeupdateTimer.stop();
&gt;          break;</span >

Instead of adding a new instance variable to track state, can you just set current time to 0 when playback state changes from ENDED to PLAYING?

    case PLAYING:
        if (oldReadyState == ENDED)
            m_clock-&gt;setCurrentTime(0);
        eventName = eventNames().playingEvent;
        m_clock-&gt;start();
        startTimeupdateTimer();
        break;</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>