<?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>224747</bug_id>
          
          <creation_ts>2021-04-19 03:47:30 -0700</creation_ts>
          <short_desc>&quot;A MediaStreamTrack ended due to a capture failure&quot; if trying to show the stream in a video tag not appended to DOM</short_desc>
          <delta_ts>2021-04-19 04:39:00 -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>WebRTC</component>
          <version>Safari 14</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 14</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Francesco Durighetto (kekkokk)">francesco.durighetto</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1751725</commentid>
    <comment_count>0</comment_count>
    <who name="Francesco Durighetto (kekkokk)">francesco.durighetto</who>
    <bug_when>2021-04-19 03:47:30 -0700</bug_when>
    <thetext>There is a bug in safari 14 (reproducible only on mobile devices (iPhone/iPad) where a mediastream from getusermedia fires a: &quot;A MediaStreamTrack ended due to a capture failure&quot; if this stream is attached to a video element not present in DOM.

also, this is a bit tricky because it crashes when calling .play() on videoElement if this element is NOT attached to dom.
but if this videoElement is NOT attached. to DOM BUT it has the autoplay attribute AND you does not invoke the .play() method it seems to work.

I think the best way to describe this bug is via a simple snippet so you can try the different combinations of events and better understand the problem.

https://codepen.io/francesco-d/full/MWJqOwq</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751728</commentid>
    <comment_count>1</comment_count>
    <who name="Francesco Durighetto (kekkokk)">francesco.durighetto</who>
    <bug_when>2021-04-19 04:09:27 -0700</bug_when>
    <thetext>(In reply to Francesco from comment #0)
&gt; There is a bug in safari 14 (reproducible only on mobile devices
&gt; (iPhone/iPad) where a mediastream from getusermedia fires a: &quot;A
&gt; MediaStreamTrack ended due to a capture failure&quot; if this stream is attached
&gt; to a video element not present in DOM.
&gt; 
&gt; also, this is a bit tricky because it crashes when calling .play() on
&gt; videoElement if this element is NOT attached to dom.
&gt; but if this videoElement is NOT attached. to DOM BUT it has the autoplay
&gt; attribute AND you does not invoke the .play() method it seems to work.
&gt; 
&gt; I think the best way to describe this bug is via a simple snippet so you can
&gt; try the different combinations of events and better understand the problem.
&gt; 
&gt; https://codepen.io/francesco-d/full/MWJqOwq

Doesnotwork: safari mobile 14.0.1
Seems fixed in safari mobile 14.0.3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751732</commentid>
    <comment_count>2</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2021-04-19 04:39:00 -0700</bug_when>
    <thetext>Thanks for the testing Francesco.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>