Intel® Collaboration Suite for WebRTC
Community support and discussions on the Intel® Collaboration Suite for WebRTC (Intel® CS for WebRTC).

Can't open video capture device.

Somnus_Chen
Beginner
286 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
286 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!

0 Kudos
Reply