Intel® Collaboration Suite for WebRTC
Community support and discussions on the Intel® Collaboration Suite for WebRTC (Intel® CS for WebRTC).
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646

Can't open video capture device.

Somnus_Chen
Beginner
95 Views

Dear Solution,
In IE,I code as follow:
window.onbeforeunload=function(){
    if(localStream){
        localStream.close(); //error:cannot find function "getTracks()"

   }
  if(localStream.channel && typeof localStream.channel.close==='function'){

    localStream.channel.close();
  }

}
}
If I try to create LocalStream with "{video:{device:'camera',resolution:'vga'},audio:true}", camera will be released after close the IE TAB.But if I try to 
 create LocalStream with "{video:false,audio:true}", camera will not be released. It seems that the code in onbeforeunload useless.
How to release my localStream correctly?
Thanks for your help.

 

 

0 Kudos
1 Reply
Chunbo_H_Intel1
Employee
95 Views

This is how we stop capturing in our sample and no such issue as mentioned by them.
window.onbeforeunload = function(){
    if(localStream){
      p2p.unpublish(localStream,$('#target-uid').val());
      localStream.close();
    }
    p2p.stop($('#target-uid').val());
  }


Are you using SDK-3.0? Also please make sure stream is unpublished and session stopped before unload the page.

Thanks!

Reply