<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - TAKE 2: Pass down website autoplay policies to media elements"
   href="https://bugs.webkit.org/show_bug.cgi?id=167355#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - TAKE 2: Pass down website autoplay policies to media elements"
   href="https://bugs.webkit.org/show_bug.cgi?id=167355">bug 167355</a>
              from <span class="vcard"><a class="email" href="mailto:mrajca&#64;apple.com" title="Matt Rajca &lt;mrajca&#64;apple.com&gt;"> <span class="fn">Matt Rajca</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=167355#c2">comment #2</a>)
<span class="quote">&gt; Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=299566&amp;action=diff" name="attach_299566" title="Patch">attachment 299566</a> <a href="attachment.cgi?id=299566&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=299566&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=299566&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebCore/loader/DocumentLoader.h:471
&gt; &gt; +    std::optional&lt;bool&gt; m_audioPlaybackRequiresUserGesture;
&gt; &gt; +    std::optional&lt;bool&gt; m_videoPlaybackRequiresUserGesture;
&gt; 
&gt; I think this should be a 3-state enum, probably with a different name like
&gt; m_audioPlaybackPolicy.
&gt; enum class AutoplayPolicy {
&gt;     RequireUserGesture,
&gt;     AutoPlay,
&gt;     AutoPlayWithoutSound,
&gt;     Default, &lt;-- This name might need to be more descriptive indicating that
&gt; the policy hasn't been set by the WebsitePolicies so default to the Settings
&gt; value.  Maybe just a comment explaining this.
&gt;     etc.
&gt; }
&gt; These two could probably even be made into one enum</span >

Done.

<span class="quote">&gt; 
&gt; &gt; Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:820
&gt; &gt; +#if PLATFORM(MAC)
&gt; 
&gt; Let's get rid of this now that it doesn't do anything for other platforms.</span >

Okay, and I made the tests run on iOS as well.

<span class="quote">&gt; 
&gt; &gt; Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:823
&gt; &gt; +        documentLoader-&gt;setAudioPlaybackRequiresUserGesture(std::optional&lt;bool&gt;());
&gt; 
&gt; std::nullopt</span >

Not necessary with the changes above.</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>