RESOLVED FIXED 149154
CurrentTime on mediaController is set as 0 when playback is completed.
https://bugs.webkit.org/show_bug.cgi?id=149154
Summary CurrentTime on mediaController is set as 0 when playback is completed.
sangdeug
Reported 2015-09-15 01:20:37 PDT
Clear timing for current time need to be changed to next playback, not playback complete timing. Test site : http://www.w3.org/2010/05/video/mediaevents.html
Attachments
Patch (3.01 KB, patch)
2015-09-15 02:38 PDT, sangdeug
no flags
Patch (5.17 KB, patch)
2015-09-15 21:20 PDT, sangdeug
no flags
Patch (4.78 KB, patch)
2015-09-17 17:48 PDT, sangdeug
no flags
Patch (4.46 KB, patch)
2015-09-17 21:17 PDT, sangdeug
no flags
sangdeug
Comment 1 2015-09-15 02:38:01 PDT
Alexey Proskuryakov
Comment 2 2015-09-15 13:52:01 PDT
Can a regression test be added for this fix?
sangdeug
Comment 3 2015-09-15 21:20:43 PDT
sangdeug
Comment 4 2015-09-15 23:17:36 PDT
Add test case for this fix. Check the currentTime of mediacontroller is greater than 0 on ended event.
Darin Adler
Comment 5 2015-09-16 09:45:05 PDT
Comment on attachment 261294 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=261294&action=review > Source/WebCore/html/MediaController.h:157 > + bool m_resetCurrentTimeInNextPlay; For new code, we should initialize in the header: bool m_resetCurrentTimeInNextPlay { false };
Darin Adler
Comment 6 2015-09-16 09:45:54 PDT
Comment on attachment 261294 [details] Patch I’d like to review, but I think a media expert should review this to see if it’s done correctly.
Eric Carlson
Comment 7 2015-09-16 10:01:06 PDT
Comment on attachment 261294 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=261294&action=review > Source/WebCore/html/MediaController.cpp:458 > case ENDED: > eventName = eventNames().endedEvent; > + m_resetCurrentTimeInNextPlay = true; > m_clock->stop(); > - m_clock->setCurrentTime(0); > m_timeupdateTimer.stop(); > 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;
sangdeug
Comment 8 2015-09-16 18:59:58 PDT
Comment on attachment 261294 [details] 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?
Eric Carlson
Comment 9 2015-09-17 07:33:49 PDT
Comment on attachment 261294 [details] 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. OK. In any case, you should handle this in the switch statement: case PLAYING: if (m_resetCurrentTimeInNextPlay) m_clock->setCurrentTime(0); m_resetCurrentTimeInNextPlay = false; eventName = eventNames().playingEvent; m_clock->start(); startTimeupdateTimer(); break; >>> 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? For new code, the WebKit style is initialize in the header instead of in the constructor.
sangdeug
Comment 10 2015-09-17 17:48:19 PDT
sangdeug
Comment 11 2015-09-17 17:49:15 PDT
Comment on attachment 261294 [details] 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. > > OK. In any case, you should handle this in the switch statement: > > case PLAYING: > if (m_resetCurrentTimeInNextPlay) > m_clock->setCurrentTime(0); > m_resetCurrentTimeInNextPlay = false; > eventName = eventNames().playingEvent; > m_clock->start(); > startTimeupdateTimer(); > break; Done. >>>> 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? > > For new code, the WebKit style is initialize in the header instead of in the constructor. Done.
Eric Carlson
Comment 12 2015-09-17 18:49:46 PDT
Comment on attachment 261465 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=261465&action=review r=me with one minor nit. Thanks! > Source/WebCore/html/MediaController.cpp:60 > + , m_resetCurrentTimeInNextPlay(false) Nit: this is unnecessary because you have already initialized it in the header.
sangdeug
Comment 13 2015-09-17 21:17:06 PDT
Eric Carlson
Comment 14 2015-09-18 10:37:23 PDT
Comment on attachment 261479 [details] Patch Thank you!
Eric Carlson
Comment 15 2015-09-21 10:59:12 PDT
sangdeug - if you want someone to land your patch, mark it "cq?" and any committer can land it manually or mark it "cq+" and the commit bot will land it automatically.
WebKit Commit Bot
Comment 16 2015-09-21 16:29:33 PDT
Comment on attachment 261479 [details] Patch Rejecting attachment 261479 [details] from commit-queue. sangdeug.kim@samsung.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/contributors.json. - If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags. - If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/contributors.json by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your committer rights.
WebKit Commit Bot
Comment 17 2015-09-21 16:30:45 PDT
Comment on attachment 261479 [details] Patch Rejecting attachment 261479 [details] from commit-queue. sangdeug.kim@samsung.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/contributors.json. - If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags. - If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/contributors.json by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your committer rights.
WebKit Commit Bot
Comment 18 2015-09-22 06:59:57 PDT
Comment on attachment 261479 [details] Patch Clearing flags on attachment: 261479 Committed r190114: <http://trac.webkit.org/changeset/190114>
WebKit Commit Bot
Comment 19 2015-09-22 07:00:02 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.