<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 - Safari throws error when changing transceiver.direction"
   href="https://bugs.webkit.org/show_bug.cgi?id=191698">191698</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Safari throws error when changing transceiver.direction
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>Safari Technology Preview
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>macOS 10.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>WebRTC
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>ibc@aliax.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>youennf@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=354958" name="attach_354958" title="Script that reproduces the issue. Just run it in Safari 12.1 console with "Unified-Plan" enabled.">attachment 354958</a> <a href="attachment.cgi?id=354958&action=edit" title="Script that reproduces the issue. Just run it in Safari 12.1 console with "Unified-Plan" enabled.">[details]</a></span>
Script that reproduces the issue. Just run it in Safari 12.1 console with "Unified-Plan" enabled.

* Latest Safari Tech Preview 12.1 (15-Nov-2018)
* "WebRTC Unified-Plan" enabled in menu "Develop / Experimental Features".

Scenario:

- Add a mic transceiver with "sendonly" direction. Create offer and apply it.

- Remove the mic track using pc.removeTrack(transceiver.sender). Create offer and apply it.

- Add again the mic track using transceiver.replaceTrack(track) and changing transceiver.direction = "sendonly".

It throws "InvalidStateError: The object is in an invalid state."

This should not happen. The app should be able to change transceiver.direction at any time. And in this case, the app does need to set transceiver.direction="sendonly" since it's not supposed to be automatically changed after replacing the sending track.

This works in Chrome and Firefox.</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>