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

Broadcast resolution #38

Closed ghost closed 6 years ago

ghost commented 7 years ago

Is there a way to limit the Broadcasted Resoultion? My camera or any camera lately is 4K ultra HD at 1000000x300000 or whatever. That size doesn't go down the comcast wires all that well. Especially on mobile.

I'm using and messing around and testing your basic install but with the V2 .js. What and where would I edit to restrict the broadcast video size to something other then default... whatever the default is. I'm at a loss to where that can be controlled.

Thank you.

stephenlb commented 6 years ago

Set Camera Resolution

You can change the resolution of your camera's media capture. This allows you to set lower resolutions for slower p2p connections. You can also set HD 4K resolutions if you have the camera to do so.

// Phone
const phone = PHONE({
    number        : number
,   media         : { video: { width:1280, height:720 } } // <---- change resolution
,   publish_key   : pubkey
,   subscribe_key : subkey 
});