<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>286358</bug_id>
          
          <creation_ts>2025-01-22 07:13:50 -0800</creation_ts>
          <short_desc>Sender priority settings set when adding tracks to an RTC Peer Connection are ignored</short_desc>
          <delta_ts>2025-11-06 13:52:58 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebRTC</component>
          <version>Safari 18</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 15</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>marco</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>h</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2088977</commentid>
    <comment_count>0</comment_count>
    <who name="">marco</who>
    <bug_when>2025-01-22 07:13:50 -0800</bug_when>
    <thetext>The JS API in Safari supports setting `parameters.encodings.priority` via `RTCRtpSender.setParameters()` (see https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/setParameters#browser_compatibility). However, the RTP packets that are actually sent by Safari always contain a default priority header, regardless of what priority is being set via JS.

To reproduce:
- Establish a WebRTC Peer connection between 2 peers
- Create a Media Stream, for example by getting access to user media with `getUserMedia()`
- For each track of the media stream, add it to the peer connection and update its parameter encodings by setting priority to &apos;high&apos;:

  stream.getTracks().forEach((track) =&gt; {
    let sender = this._connection.addTrack(track, stream);
    const params = sender.getParameters();
      params.encodings = params.encodings.map((e) =&gt; {
        if (e.priority) {
          e.priority = &apos;high&apos;;
        }
        if (e.networkPriority) {
          e.networkPriority = &apos;high&apos;;
        }
        return e;
      });
      sender.setParameters(params);
  });

- Capture the packets using Wireshark and inspect the packet headers.

Expected behaviour
The packet header under IPv4 &gt; Differentiated Services Field should be set to &quot;Expedited Forwarding (46)&quot;.

Actual behaviour
The packet header is set to &quot;Default (0)&quot;.

Related issue:
https://bugs.webkit.org/show_bug.cgi?id=277605

For more context on the use of the priority encodings and the effects of the bug, see:
https://github.com/versatica/JsSIP/pull/893</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2090430</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-01-29 07:14:16 -0800</bug_when>
    <thetext>&lt;rdar://problem/143820797&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>