<?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>230922</bug_id>
          
          <creation_ts>2021-09-28 16:05:09 -0700</creation_ts>
          <short_desc>REGRESSION (iOS 15): Autoplayed video element with mediaStream srcObject freezes</short_desc>
          <delta_ts>2023-11-17 00:19:14 -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>Media</component>
          <version>Other</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</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="Alec Bargas">abargas</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>908589510</cc>
    
    <cc>cdumez</cc>
    
    <cc>chris.mo</cc>
    
    <cc>csantos</cc>
    
    <cc>ddp.bkdn</cc>
    
    <cc>electroteque</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>jameshoward</cc>
    
    <cc>jean-yves.avenard</cc>
    
    <cc>jer.noble</cc>
    
    <cc>Kongpheng.Nanthavongsa</cc>
    
    <cc>lprenji</cc>
    
    <cc>mark.burrett</cc>
    
    <cc>peng.liu6</cc>
    
    <cc>steve.mieskoski+webkit</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>will.morgan</cc>
    
    <cc>yevhen.lv.developer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1798093</commentid>
    <comment_count>0</comment_count>
    <who name="Alec Bargas">abargas</who>
    <bug_when>2021-09-28 16:05:09 -0700</bug_when>
    <thetext>A video element with the &apos;autoplay + playsinline + muted&apos; property set with a mediaStream srcObject can freeze. This freeze can either occur before the video starts playing (so the background is seen) or a single frame is frozen. The expectation is that the video should play continuously without freezing.

This behavior can be seen on the https://webrtc.github.io/samples/src/content/capture/canvas-video/ sample page.
The steps to reproduce the bug are:
1. Navigate to page.
2. Drag on the canvas (first teapot if two exist) and observe.
3a. If after dragging, a second teapot (appears if one didn&apos;t exist before and) moves, then the issue did not reproduce (move on to 4a).
3b. If after dragging a second teapot did not move, then the issue was reproduced and no need to follow the next steps.
4a. Close the tab, kill Safari, and relaunch Safari.
5a. From history, select the sample page.
6a. Drag on the canvas and observe, the issue should be seen.

When this happens, the media stream and tracks are still active and the video element is not paused. If the video is unmuted and the stream includes audio, the audio will still play. If using an iPad, putting Safari into split screen updates the video to what looks like the most recent frame, but the video still does not update continuously. On either iPad or iPhone, backgrounding Safari then coming back will allow the video to update continuously.

Reproduces with:
Version/15.0 Safari/605.1.15 (iOS 15.0)
Version/15.0 Safari/605.1.15 (iPadOS 15.1)

Does not reproduce with:
Prior to iOS 15 beta 8
Version/14.1.2 Safari/605.1.15 (macOS Big Sur 11.6)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1798507</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-09-29 12:53:26 -0700</bug_when>
    <thetext>&lt;rdar://problem/83684099&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1799373</commentid>
    <comment_count>2</comment_count>
    <who name="Will Morgan">will.morgan</who>
    <bug_when>2021-10-01 10:20:49 -0700</bug_when>
    <thetext>This regression is affecting a number of our users and is blocking them from advancing through several important user journeys - authenticating to banks and healthcare etc. Could this be looked at urgently?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1800026</commentid>
    <comment_count>3</comment_count>
    <who name="Mark B">mark.burrett</who>
    <bug_when>2021-10-04 04:20:19 -0700</bug_when>
    <thetext>This issue is affecting users of our web application in production. We would appreciate feedback on the planned resolution and timeline.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1803092</commentid>
    <comment_count>4</comment_count>
    <who name="Nils R">lprenji</who>
    <bug_when>2021-10-12 07:08:48 -0700</bug_when>
    <thetext>I can confirm and reproduce the bug.
It is also affecting our customers.

Feedback would be appreciate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1803113</commentid>
    <comment_count>5</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2021-10-12 07:58:53 -0700</bug_when>
    <thetext>There is a known regression in canvas capture streams that is being worked on.
I am unclear though whether that bug is specific to canvas capture stream or also applies to camera and/or peer connection media streams.
Can anybody of you clarify?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1803114</commentid>
    <comment_count>6</comment_count>
    <who name="Will Morgan">will.morgan</who>
    <bug_when>2021-10-12 08:00:09 -0700</bug_when>
    <thetext>Hi Youenn, our application makes use of getUserMedia and the video element. We don&apos;t use CanvasCaptureMediaStreamTrack et al, at all.

Hopefully that clarifies?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1803119</commentid>
    <comment_count>7</comment_count>
    <who name="Nils R">lprenji</who>
    <bug_when>2021-10-12 08:14:27 -0700</bug_when>
    <thetext>In our case the we use peer connection media streams and add those to a srcObject to a videoElement. It displays nothing as in the webrtc sample.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1803128</commentid>
    <comment_count>8</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2021-10-12 08:38:27 -0700</bug_when>
    <thetext>Thanks.
Would you have repro cases? 
https://webrtc.github.io/samples/src/content/peerconnection/pc1/ should hopefully work fine.

Or you can send privately to me sysdiagnoses (youenn@apple.com).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1804727</commentid>
    <comment_count>9</comment_count>
    <who name="Chris Mo">chris.mo</who>
    <bug_when>2021-10-15 00:53:59 -0700</bug_when>
    <thetext>Our application have same issue start from Safari Technology Preview 126 or above.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1807636</commentid>
    <comment_count>10</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2021-10-22 04:55:24 -0700</bug_when>
    <thetext>https://webrtc.github.io/samples/src/content/capture/canvas-video/ has an issue with canvas capture so I do not think it is good to consider it for .
Does any of you have a different repro case that I can use, not based on canvas capture?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1808706</commentid>
    <comment_count>11</comment_count>
    <who name="Kongpheng">Kongpheng.Nanthavongsa</who>
    <bug_when>2021-10-25 18:34:04 -0700</bug_when>
    <thetext>Youenn, using the sample repo you mentioned, it&apos;s possible to see video not auto-resume as expected.  Granted this isn&apos;t the same as freezing, but just wanted to share, in case it was helpful:
* Open https://webrtc.github.io/samples/src/content/peerconnection/pc1/
* Click Start button
* Grant access to microphone and camera
* Notice video is captured
* Make a call to the iPhone
* From Call UI dialog, decline it
* Notice that video doesn&apos;t get auto-resumed, instead you see a black rectangle where video used to be

This might be more similar to https://bugs.webkit.org/show_bug.cgi?id=231365 though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1811973</commentid>
    <comment_count>12</comment_count>
    <who name="Charlie">csantos</who>
    <bug_when>2021-11-04 14:58:38 -0700</bug_when>
    <thetext>I&apos;m able to reproduce using Youenn&apos;s sample repo. I added &apos;muted&apos; property on the remote video. See it here https://charliesantos.github.io/samples/src/content/peerconnection/pc1/

Steps:
1. Load https://charliesantos.github.io/samples/src/content/peerconnection/pc1/
2. Press start then call button, grant access to the mic/camera
3. Make sure the video is captured
4. Make a phone call to the iPhone. Have it ring for about 10-15 seconds
5. Swipe up the call notification to go back to the page
6. Press Hang Up button, or interact to the page. Notice that the whole page is frozen.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1812546</commentid>
    <comment_count>13</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2021-11-08 00:30:09 -0800</bug_when>
    <thetext>@Charlie, the freeze should be fixed in latest iOS 15.2 beta.
@Kongpheng, I think this is also the case in latest iOS 15.2 beta, can you validate and if not file another bug?
@Alec, the issue with the tea pot is related to canvas capture and is being worked on. Latest Safari Tech Preview should be working. Please reopen if that is not the case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1838069</commentid>
    <comment_count>14</comment_count>
    <who name="Yevhen Lv">yevhen.lv.developer</who>
    <bug_when>2022-02-07 04:47:56 -0800</bug_when>
    <thetext>Hi. iOS 15.2 has same problem. Using Webrtc without canvas, only simple video.
Chrome, Safari, Firefox with started video call freezes after incoming call.

Black screen instead video and page doesn&apos;t react on touches. Sometimes page reload helps, but usually I should close chrome and open it again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1855034</commentid>
    <comment_count>15</comment_count>
    <who name="PhungDuong">ddp.bkdn</who>
    <bug_when>2022-03-25 00:48:28 -0700</bug_when>
    <thetext>For this black camera error, we can sometimes reproduce it on iOS 15.3 and 15.4 on my WebRTC product.
Feedback would be appreciated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1874114</commentid>
    <comment_count>16</comment_count>
    <who name="PhungDuong">ddp.bkdn</who>
    <bug_when>2022-06-04 02:36:22 -0700</bug_when>
    <thetext>Hi @youenn,

We can confirm and reproduce this bug on iOS/iPadOS 15.4.1
Here are steps to reproduce:
1. Open the link using webRTC (https://it.dev-akameet.link/video/room/videocall)
2. Allow micro and camera.
3. Click the button to join the meeting.
Expected: The local video is normal.
Actual: The local video is black.

Note: From step 2 to step 3 do with speed as fast as possible. When you can&apos;t repo it, close the safari, open it again, and repeat the steps above, because the frequency isn&apos;t 100%.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1874115</commentid>
    <comment_count>17</comment_count>
    <who name="PhungDuong">ddp.bkdn</who>
    <bug_when>2022-06-04 02:50:19 -0700</bug_when>
    <thetext>(In reply to PhungDuong from comment #16)
&gt; Hi @youenn,
&gt; 
&gt; We can confirm and reproduce this bug on iOS/iPadOS 15.4.1
&gt; Here are steps to reproduce:
&gt; 1. Open the link using webRTC
&gt; (https://it.dev-akameet.link/video/room/videocall)
&gt; 2. Allow micro and camera.
&gt; 3. Click the button to join the meeting.
&gt; Expected: The local video is normal.
&gt; Actual: The local video is black.
&gt; 
&gt; Note: From step 2 to step 3 do with speed as fast as possible. When you
&gt; can&apos;t repo it, close the safari, open it again, and repeat the steps above,
&gt; because the frequency isn&apos;t 100%.

Also can repo this on iOS/iPadOS 15.5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1959771</commentid>
    <comment_count>18</comment_count>
    <who name="Daniel Rossi">electroteque</who>
    <bug_when>2023-06-04 15:02:22 -0700</bug_when>
    <thetext>Confirming this an issue, I&apos;ve implemented canvas fullscreen support for iPhone using MediaStream and getting autoplay working was difficult. Muted stops autoplaying or it freezes. I think even playsinline causes it to fail. I don&apos;t need it inline I need a second video going fullscreen anyway. 

https://github.com/danrossi/canvas-pip-fullscreen/blob/main/src/CanvasFullscreen.js#L26</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1993362</commentid>
    <comment_count>19</comment_count>
    <who name="jeeinn">908589510</who>
    <bug_when>2023-11-17 00:19:14 -0800</bug_when>
    <thetext>In iOS17.1.1 Safari will appear to autoplay but randomly go to full screen. 
In iOS17.2Beta3 it will automatically go to full screen black screen but won&apos;t play, when clicking on the picture-in-picture mode it can play normally

https://github.com/jeeinn/video_srcObject/blob/834922287206273c2e9bcad85819de775d4b1088/index.html#L65-L67

```
stream = canvas.captureStream();
video = document.getElementById(&apos;theVideo&apos;);
video.srcObject = stream;
```</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>