<?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>274195</bug_id>
          
          <creation_ts>2024-05-14 21:03:55 -0700</creation_ts>
          <short_desc>[MSE] If src attribute is defined, ignore source alternative</short_desc>
          <delta_ts>2024-05-15 16:31:41 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=274142</see_also>
          <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 name="Jean-Yves Avenard [:jya]">jean-yves.avenard</reporter>
          <assigned_to name="Jean-Yves Avenard [:jya]">jean-yves.avenard</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2035435</commentid>
    <comment_count>0</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2024-05-14 21:03:55 -0700</bug_when>
    <thetext>Per spec, if a media element has a src attribute defined, `&lt;source&gt;` are ignored [1] as a consequence of the media source selection algorithm [2]

step 6:
```
⌛ If the media element has an assigned media provider object, then let mode be object.

⌛ Otherwise, if the media element has no assigned media provider object but has a src attribute, then let mode be attribute.

⌛ Otherwise, if the media element does not have an assigned media provider object and does not have a src attribute, but does have a source element child, then let mode be children and let candidate be the first such source element child in tree order.
```

Currently, to check if we have a remote playback alternative, we only check if a playable alternative source is defined, and if so allow playback. But if a src (or srcObject) is defined, when selecting an AirPlay target those sources will be ignored.

So we need HTMLMediaElement::hasWirelessPlaybackTargetAlternative() to return false unless `m_loadState != LoadingFromSourceElement`

[1] https://html.spec.whatwg.org/multipage/media.html#attr-media-src
[2] https://html.spec.whatwg.org/multipage/media.html#concept-media-load-algorithm</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2035472</commentid>
    <comment_count>1</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2024-05-14 23:11:57 -0700</bug_when>
    <thetext>rdar://128098363</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2035473</commentid>
    <comment_count>2</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2024-05-14 23:22:14 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/28584</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2035661</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-05-15 16:31:39 -0700</bug_when>
    <thetext>Committed 278834@main (fb01f8840fd2): &lt;https://commits.webkit.org/278834@main&gt;

Reviewed commits have been landed. Closing PR #28584 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>