Re: [mediacapture-main] A privacy concern of "Media Capture and Streams" (#630)

>>  A source that is notified of a track ending will be stopped, unless other MediaStreamTrack objects depend on it.
>
> This description is a bit vague for me, what are the `other MediaStreamTrack objects`? I'm not sure if it's possible to hijack the related MediaStreamTrack objects so that hijack the MIC.

Good question. 

There does not appear to be a concrete example in code at the specification.

Following the link to "stopped" "source" appears to be referring to the media source device. 

Consider attempting to reproduce the language of the specification in code

```
navigator.mediaDevices.getUserMedia({video: true})
.then(stream => {
  const video = document.createElement("video");
  video.muted = video.autoplay = true;
  document.body.insertAdjacentElement("beforeend", video);
  const [track] = stream.getVideoTracks();
  const otherTrack = track.clone();
  const otherStream = new MediaStream([otherTrack]);
  video.srcObject = otherStream;
  setTimeout(() => {
    track.stop();
    track.enabled = false;
    console.log(track.readyState, otherTrack.readyState, stream.active, otherStream.active); 
   }, 3000);
})
.catch(console.error);

when `track` is "stopped" permission is not "revoked", `otherTrack` is not "ended", `otherTrack` continues playback at `<video>` element.

In this case with a cloned `otherTrack` permission is "revoked" when `track` is "stopped" does not continue playback at `<video>` element

```
navigator.mediaDevices.getUserMedia({video: true})
.then(stream => {
  const video = document.createElement("video");
  video.muted = video.autoplay = true;
  document.body.insertAdjacentElement("beforeend", video);
  const [track] = stream.getVideoTracks();
  video.srcObject = stream;
  setTimeout(() => {
    track.stop();
    track.enabled = false;
    console.log(track.readyState, stream.active); 
   }, 3000);
})
.catch(console.error);
```



-- 
GitHub Notification of comment by guest271314
Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/630#issuecomment-544206033 using your GitHub account

Received on Saturday, 19 October 2019 23:35:32 UTC