<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Delay in response to encryption events while paused causes MEDIA_DECODE_ERROR"
   href="https://bugs.webkit.org/show_bug.cgi?id=165052">165052</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Delay in response to encryption events while paused causes MEDIA_DECODE_ERROR
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Safari 10
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>macOS 10.12
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Media Elements
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>boushley&#64;gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Reproduction Steps:
1. Start playback of a video that has FairPlay DRM.
2. Pause the video (doesn't matter if video has actually begun playback or not)
3. Switch tabs (or focus other applications), this causes a webkitneedkey event to be fired
4. Wait 10-15 seconds after this webkitneedkey event (keeping the video tab in focus)

Expected Results:
Nothing happens. The video element is able to sit idle without responses to encryption/needkey as long as it remains paused. This was the behavior on OSX 10.11.

Actual Results:
On macOS 10.12 a Media Error with Code 3 (MEDIA_ERR_DECODE) is fired.

A simplified version of this error can be seen here: <a href="https://jsfiddle.net/boushley/uprzdx1o/">https://jsfiddle.net/boushley/uprzdx1o/</a>

In our real use case we are waiting for the user to actively click play before handling some session setup that is needed to have successful license requests. For this reason we end up with delays that are long enough to trigger this error behavior when the user re-focuses the browser, but doesn't click play.</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>