PolymerElements / app-media

Elements for accessing data from media input devices and visualizing that data for users
61 stars 12 forks source link

app-media-stream fails to stop camera access when 'active' property set to false. #41

Open Iheartweb opened 6 years ago

Iheartweb commented 6 years ago

Description

app-media-stream fails to stop camera access when 'active' property set to false.

Expected outcome

When app-media-stream.active is set to false, all media tracks should be stopped and Chrome should no longer indicate that website is accessing camera.

Actual outcome

Chrome indicates that website is accessing camera (recording red dot in tab in desktop or notification on mobile) until tab is killed or page is refreshed.

Steps to reproduce

  1. Add app-media-stream to page with some video constraints and active = true.
  2. Browser indicates that website is accessing camera.
  3. Set active = false
  4. Browser still indicates that website is accessing camera.

Browsers Affected

Only tested on latest stable Chrome.

spiderix commented 6 years ago

I had simlar issue. Before i set active to false just run stop track:

if (this.stream != null) {
     this.stream.getTracks().forEach(function (track) {
         track.stop();
     });
 }
this.active= false;
JaySunSyn commented 6 years ago

Same issue with microphone access.

@spiderix workaround solves it for me!