所以,我发现这个文件在这里说(https://simplewebrtc.com/notsosimple.html):
var webrtc = new SimpleWebRTC({
localVideoEl: 'localVideo',
remoteVideosEl: 'remotesVideos',
autoRequestMedia: true,
url: 'https://example.com/'
//use the media options to pass constraints for getUserMedia requests
media: mediaOptions
});
或者你有修改库:
SimpleWebRTC.prototype.startLocalVideo = ->
self = this
this.config.constraints ||= {video: true, audio: true}
this.webrtc.startLocalMedia this.config.constraints, (err, stream)->
if err
self.emit(err)
else
attachMediaStream(stream,
self.getLocalVideoContainer(),
{muted: true, mirror: true})
然后
webrtc = new SimpleWebRTC
localVideoEl: 'localVideo'
remoteVideosEl: 'remotes'
autoRequestMedia: true
debug: true
detectSpeakingEvents: true
autoAdjustMic: false
constraints:
audio: true
video:
mandatory:
maxWidth: 320
maxHeight: 180
这里的黑客 http://blog.dev.zyncro-china.com/2014/02/25/hacking-simplewebrtc-js-to-change-the-video-resolution/