app-media icon indicating copy to clipboard operation
app-media copied to clipboard

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

Open Iheartweb opened this issue 7 years ago • 2 comments

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.

  • [x] Chrome
  • [ ] Firefox
  • [ ] Safari 9
  • [ ] Safari 8
  • [ ] Safari 7
  • [ ] Edge
  • [ ] IE 11
  • [ ] IE 10

Iheartweb avatar Nov 29 '17 21:11 Iheartweb

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;

spiderix avatar Dec 17 '17 13:12 spiderix

Same issue with microphone access.

@spiderix workaround solves it for me!

JaySunSyn avatar Mar 08 '18 20:03 JaySunSyn