[Webkit-unassigned] [Bug 149154] CurrentTime on mediaController is set as 0 when playback is completed.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 16 18:59:58 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=149154

--- Comment #8 from sangdeug <sangdeug.kim at samsung.com> ---
Comment on attachment 261294
  --> https://bugs.webkit.org/attachment.cgi?id=261294
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=261294&action=review

>> Source/WebCore/html/MediaController.cpp:458
>>          break;
> 
> 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->setCurrentTime(0);
>         eventName = eventNames().playingEvent;
>         m_clock->start();
>         startTimeupdateTimer();
>         break;

I tried to using oldPlaybackState but during my test, sometimes I observed that the WAITING event is comming between ENDED and PLAYING. 

e.g) 
ENDED -> PLAYING
ENDED -> WAITING -> PLAYING

To cover both case, I added a new variable to track state.

>> Source/WebCore/html/MediaController.h:157
>> +    bool m_resetCurrentTimeInNextPlay;
> 
> For new code, we should initialize in the header:
> 
>     bool m_resetCurrentTimeInNextPlay { false };

It's initialized in constructor, do I need initialize in head also?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150917/22a17832/attachment-0001.html>


More information about the webkit-unassigned mailing list