Bug 224747 - "A MediaStreamTrack ended due to a capture failure" if trying to show the stream in a video tag not appended to DOM
Summary: "A MediaStreamTrack ended due to a capture failure" if trying to show the str...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 14
Hardware: iPhone / iPad iOS 14
: P2 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-19 03:47 PDT by Francesco Durighetto (kekkokk)
Modified: 2021-04-19 04:39 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francesco Durighetto (kekkokk) 2021-04-19 03:47:30 PDT
There is a bug in safari 14 (reproducible only on mobile devices (iPhone/iPad) where a mediastream from getusermedia fires a: "A MediaStreamTrack ended due to a capture failure" 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
Comment 1 Francesco Durighetto (kekkokk) 2021-04-19 04:09:27 PDT
(In reply to Francesco from comment #0)
> There is a bug in safari 14 (reproducible only on mobile devices
> (iPhone/iPad) where a mediastream from getusermedia fires a: "A
> MediaStreamTrack ended due to a capture failure" 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

Doesnotwork: safari mobile 14.0.1
Seems fixed in safari mobile 14.0.3
Comment 2 youenn fablet 2021-04-19 04:39:00 PDT
Thanks for the testing Francesco.