Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner

Can't open video capture device.

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.

 

 

Tags (2)
0 Kudos
1 Reply
Highlighted

This is how we stop capturing

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