Bug 156284 - [WinCairo][MediaFoundation] Videos are always autoplaying.
Summary: [WinCairo][MediaFoundation] Videos are always autoplaying.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-06 03:27 PDT by peavo
Modified: 2019-05-27 20:24 PDT (History)
4 users (show)

See Also:


Attachments
Patch (10.01 KB, patch)
2016-04-06 03:41 PDT, peavo
no flags Details | Formatted Diff | Diff
Patch (10.09 KB, patch)
2016-04-06 12:45 PDT, peavo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description peavo 2016-04-06 03:27:50 PDT
Videos are autoplaying because the MediaFoundation implementation always call play() after load() has been called. When load() has been called, we should only start buffering data, not automatically start the playback.
Comment 1 peavo 2016-04-06 03:41:52 PDT
Created attachment 275766 [details]
Patch
Comment 2 Alex Christensen 2016-04-06 11:44:09 PDT
Comment on attachment 275766 [details]
Patch

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

> Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:850
> +    if (progress >= 100) {

What is 100?  Does this automatically buffer 100% of the data of the video?  Is this good for HUGE videos?
Comment 3 peavo 2016-04-06 12:03:38 PDT
(In reply to comment #2)
> Comment on attachment 275766 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=275766&action=review
> 
> > Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:850
> > +    if (progress >= 100) {
> 
> What is 100?  Does this automatically buffer 100% of the data of the video? 
> Is this good for HUGE videos?

As I have understood it, this is the percentage of the amount of data you need to start playing. 100 then means you have enough data to start or continue playback.

Thanks for looking into this :)
Comment 4 Alex Christensen 2016-04-06 12:05:08 PDT
So 100 means 100% of whatever MediaFoundation thinks is enough to start playing, not the percentage of the entire video, right?  Could you give the constant 100 a name?
Comment 5 peavo 2016-04-06 12:45:52 PDT
Created attachment 275810 [details]
Patch
Comment 6 peavo 2016-04-06 12:51:07 PDT
(In reply to comment #4)
> So 100 means 100% of whatever MediaFoundation thinks is enough to start
> playing, not the percentage of the entire video, right?  Could you give the
> constant 100 a name?

Yes, according to the documentation it is the fill percentage of the playback buffer. I renamed the progress variable to 'percentageOfPlaybackBufferFilled', would that be ok?
Comment 7 peavo 2016-04-06 12:53:56 PDT
Thanks for reviewing!
Comment 8 WebKit Commit Bot 2016-04-06 13:41:50 PDT
Comment on attachment 275810 [details]
Patch

Clearing flags on attachment: 275810

Committed r199114: <http://trac.webkit.org/changeset/199114>
Comment 9 WebKit Commit Bot 2016-04-06 13:41:53 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Konstantin Tokarev 2017-08-31 08:11:02 PDT
Local files are still affected by this bug, because they don't get MEBufferingStarted/MEBufferingStopped events. Any idea what would be the right approach to fix this issue?