New issue
Advanced search Search tips

Issue 894556 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Multiple video tracks in a MediaStream are not reflected on the videoTracks object on the video element

Project Member Reported by paulkin...@google.com, Oct 11

Issue description

Google Chrome	71.0.3572.0 (Official Build) dev (64-bit)
Revision	2747bd652db387103b1b91a59dfe0d66c03b9902-refs/branch-heads/3572@{#1}
Platform	11143.0.0 (Official Build) dev-channel eve
Firmware Version	Google_Eve.9584.171.0
Customisation ID	GOOGLE-EVE
ARC	5057305
JavaScript	V8 7.1.276
Flash	31.0.0.122 

What steps will reproduce the problem?
(1) Get two MediaStreams with video tracks
(2) Add them to a new MediaStream and attach as srcObject on a videoElement
(3) Check the videoElement.videoTracks object and see there is only one track

Demo at https://multiple-tracks-bug.glitch.me/

What is the expected result?

I would expect videoElement.videoTracks to have two elements.

What happens instead?

It only has the first videoTrack that was added to the MediaStream.


window.onload = () => {
  if('getDisplayMedia' in navigator) warning.style.display = 'none';

  let blobs;
  let blob;
  let rec;
  let stream;
  let webcamStream;
  let desktopStream;

  captureBtn.onclick = async () => {

       
    desktopStream = await navigator.getDisplayMedia({video:true});
    webcamStream = await navigator.mediaDevices.getUserMedia({video: { height: 1080, width: 1920 }, audio: true});
    
    // Always 
    let tracks = [...desktopStream.getTracks(), ... webcamStream.getTracks()]
    console.log('Tracks to add to stream', tracks);
    stream = new MediaStream(tracks);
    
    console.log('Tracks on stream', stream.getTracks());
    
    videoElement.srcObject = stream;
    
    console.log('Tracks on video element that has stream', videoElement.videoTracks)
    
    // I would expect the length to be 2 and not 1
  };

};
 
Description: Show this description
Description: Show this description
Summary: Multiple video tracks in a MediaStream are not reflected on the videoTracks object on the video element (was: Multiple video tracks in a MediaStream are reflected on the videoTracks object on the video element)
Cc: guidou@chromium.org
Owner: guidou@chromium.org
Status: Assigned (was: Untriaged)

Sign in to add a comment