Bug 175005 - Support quirk for letting media autoplay if the user interacted with at least one media element
Summary: Support quirk for letting media autoplay if the user interacted with at least...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Matt Rajca
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-07-31 17:08 PDT by Matt Rajca
Modified: 2017-07-31 17:41 PDT (History)
3 users (show)

See Also:


Attachments
Patch (6.15 KB, patch)
2017-07-31 17:10 PDT, Matt Rajca
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Rajca 2017-07-31 17:08:06 PDT
Support quirk for letting media autoplay if the user interacted with at least one media element.
Comment 1 Matt Rajca 2017-07-31 17:10:56 PDT
Created attachment 316815 [details]
Patch
Comment 2 Eric Carlson 2017-07-31 17:23:08 PDT
Comment on attachment 316815 [details]
Patch

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

> Source/WebCore/ChangeLog:5
> +

Radar?

> Source/WebCore/html/MediaElementSession.cpp:194
> +    if (needsDocumentLevelMediaUserGestureQuirk(element.document()) && element.document().topDocument().mediaState() & MediaProducer::HasUserInteractedWithMediaElement)

Nit: may be worth swapping the order of the comparisons.
Comment 3 Matt Rajca 2017-07-31 17:38:28 PDT
(In reply to Eric Carlson from comment #2)
> Comment on attachment 316815 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=316815&action=review
> 
> > Source/WebCore/ChangeLog:5
> > +
> 
> Radar?

Added.

> 
> > Source/WebCore/html/MediaElementSession.cpp:194
> > +    if (needsDocumentLevelMediaUserGestureQuirk(element.document()) && element.document().topDocument().mediaState() & MediaProducer::HasUserInteractedWithMediaElement)
> 
> Nit: may be worth swapping the order of the comparisons.

Done.
Comment 4 Matt Rajca 2017-07-31 17:39:00 PDT
(In reply to Eric Carlson from comment #2)
> Comment on attachment 316815 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=316815&action=review
> 
> > Source/WebCore/ChangeLog:5
> > +
> 
> Radar?
> 
> > Source/WebCore/html/MediaElementSession.cpp:194
> > +    if (needsDocumentLevelMediaUserGestureQuirk(element.document()) && element.document().topDocument().mediaState() & MediaProducer::HasUserInteractedWithMediaElement)
> 
> Nit: may be worth swapping the order of the comparisons.

I also put the quirk in #if PLATFORM(MAC) like we talked about.
Comment 5 Matt Rajca 2017-07-31 17:39:22 PDT
Committed r220085: <http://trac.webkit.org/changeset/220085>
Comment 6 Radar WebKit Bug Importer 2017-07-31 17:41:13 PDT
<rdar://problem/33641773>