Bug 262375 - MediaStreamTrack (getUserMedia) setting is lost after cloning
Summary: MediaStreamTrack (getUserMedia) setting is lost after cloning
Status: RESOLVED DUPLICATE of bug 261329
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 16
Hardware: iPhone / iPad iOS 16
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-29 09:02 PDT by Mukesh
Modified: 2023-10-03 06:04 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mukesh 2023-09-29 09:02:45 PDT
I have encountered a bug in WebKit related to the cloning of MediaStreamTrack objects obtained through getUserMedia(). The cloned track loses its settings, specifically the resolution. 

This behavior is unexpected as it doesn't follow the w3c spec(https://www.w3.org/TR/mediacapture-streams/#dom-mediastreamtrack-clone)
Steps to Reproduce:

1 - Obtain MediaStream through getUserMedia()
2 - Attach it to DOM Video element. ----- Height 640, Width 360
3 - Clone the MediaStream using the stream.clone(), or construct new stream after cloning individual tracks.
4 - Attach it to DOM Video element.
5 - Repeat the step 3 and 4
6 - The resolution is lost after cloning 2nd times ----- Height 360, Width 640 

Expected Results:
The cloned MediaStreamTrack should retain all its settings, including dimensions, after cloning.

Actual Results:
The cloned MediaStreamTrack does not have the correct dimensions and may have other settings lost as well. It swaps the height and width

CodePen link: https://codepen.io/Mukesh-the-decoder/pen/VwqrpZv

Device: IPhone 16, Safari
Comment 1 youenn fablet 2023-10-03 06:04:11 PDT
Thanks for the report, I think this will be fixed with https://bugs.webkit.org/show_bug.cgi?id=261329

*** This bug has been marked as a duplicate of bug 261329 ***