Chrome Version: (copy from chrome://version)OS: (e.g. Win10, MacOS 10.12, etc...)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.
Please use labels and text to provide additional information.If this is a regression (i.e., worked before), please consider using thebisect tool (https://www.chromium.org/developers/bisect-builds-py) to helpus identify the root cause and more rapidly triage the issue.For graphics-related bugs, please copy/paste the contents of the about:gpupage at the end of this report.
Chrome Version: (copy from chrome://version)OS: (e.g. Win10, MacOS 10.12, etc...)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
};
};
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
};
};
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)
Comment 1 by paulkin...@google.com
, Oct 11