<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 - decodeAudioData should support .mov files recorded by iPhone"
   href="https://bugs.webkit.org/show_bug.cgi?id=228971">228971</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>decodeAudioData should support .mov files recorded by iPhone
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>iPhone / iPad
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>iOS 14
          </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>Web Audio
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned@lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rallsopp06@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>cdumez@apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In Safari for iOS, the decodeAudioData method of the WebAudio api is unable to extract an audio buffer from .mov videos recorded with iPhone, despite the fact that the <video ...> element can play these videos and their audio correctly.

Running the following example from Safari in an iPhone X, the 'it failed... err:' alert is always shown when attempting to load a .mov file recorded with the phone:

<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="UTF-8">
        <title>decodeAudioData test</title>]
</head>
<body>
<input type="file" accept="video/*" id="video-test-input">
<script>
        const fileSelector = document.getElementById('video-test-input')
        fileSelector.addEventListener('change', e => {
                const [file] = e.target.files

                const reader = new FileReader()

                reader.addEventListener('load', () => {
                        new AudioContext({sampleRate: 44100})
                                        .decodeAudioData(reader.result, function(buffer) {
                                                alert('it worked! duration: ' + buffer.duration)
                                        }, function (err) {
                                                alert('it failed... err: ' + err)
                                        })
                })

                reader.addEventListener('error', () => alert('file read failed... err: ' + reader.error))

                reader.readAsArrayBuffer(file)
        })
</script>
</body>
</html>

mp4 videos work fine with this example, but it limits the utility of this feature a lot when the videos natively recorded by the device can't be used.</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>