stephenlb / webrtc-sdk

WebRTC Simple Calling API + Mobile SDK - A simplified approach to RTCPeerConnection for mobile and web video calling apps.
https://stephenlb.github.io/webrtc-sdk/
MIT License
853 stars 278 forks source link

phone.stop() is not working #44

Closed bryanlimy closed 6 years ago

bryanlimy commented 6 years ago

I tried on both v1 and v2, phone.stop() would be get me TypeError: phone.stop is not a function.

I wonder if there is a probably to terminate a PHONE and stop using the camera/mic.

stephenlb commented 6 years ago

Checking...

stephenlb commented 6 years ago

Try: PHONE.camera.stop() or phone.camera.stop().

Looks like only the session also has this method. Try using session.stop(). I'll update the docs to reference this correctly.

stephenlb commented 6 years ago

For code reference detail on Camera/Mic Media Access:

PHONE.camera.start = startcamera;
PHONE.camera.stop  = stopcamera;
PHONE.camera.video = () => myvideo;  // <-- direct access to local media stream
bryanlimy commented 6 years ago

just tested

phone.camera.stop() works fine. it stops the MediaStreamTrack

Thanks!