W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > October 2019

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

From: guest271314 via GitHub <sysbot+gh@w3.org>
Date: Sat, 19 Oct 2019 23:35:30 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-544206033-1571528129-sysbot+gh@w3.org>
>>  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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:22:29 UTC