<?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>230738</bug_id>
          
          <creation_ts>2021-09-23 21:18:50 -0700</creation_ts>
          <short_desc>MediaSession API doesn&apos;t work in Picture in Picture.</short_desc>
          <delta_ts>2021-09-30 01:32:08 -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>Safari Technology Preview</version>
          <rep_platform>All</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</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 name="Mitsuo Matsunaga">mitsuo.matsunaga</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>eric.carlson</cc>
    
    <cc>jer.noble</cc>
    
    <cc>kevin_neal</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1796773</commentid>
    <comment_count>0</comment_count>
    <who name="Mitsuo Matsunaga">mitsuo.matsunaga</who>
    <bug_when>2021-09-23 21:18:50 -0700</bug_when>
    <thetext>I created a simple page to try out the MediaSession API.
https://tsg02.p.uliza.jp/demo/webkit-report-/media-session-api.html

1.Open this page.
2.Press the Playback button.
3.Press the Picture in Picture button.
4.In Inspector - Sources tab, set a breakpoint in the setActionHandler(&apos;pause&apos;).
5.Press the pause button in Picture in Picture.

Do not break.

Note:
Break if I operate the control center.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1797490</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2021-09-27 08:59:19 -0700</bug_when>
    <thetext>This is by design, it seems to me that the playback controls in the PiP window should be considered the same as the browser&apos;s default controls for inline or fullscreen playback. 

The spec&apos;s definition of a &quot;media session action source&quot; does leave a lot of room for interpretation, but why would the &quot;play&quot; button in the PiP window invoke the MediaSession action handler when the &quot;play&quot; button in the inline controls does not?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1798375</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-09-29 09:19:07 -0700</bug_when>
    <thetext>&lt;rdar://problem/83673931&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1798785</commentid>
    <comment_count>3</comment_count>
    <who name="Mitsuo Matsunaga">mitsuo.matsunaga</who>
    <bug_when>2021-09-30 01:32:08 -0700</bug_when>
    <thetext>In the case of inline, our players can detect button presses using our original controller.
Our players need to perform some action when the play button is pressed.
PiP window cannot be our original controller.
Therefore, we want PiP window to be the target of MediaSession API.

Not only that, we want browser&apos;s default controls to be the target of MediaSession API.
We want to disable seek while playing an ad when fullscreen on an iOS device.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>