webrtcio

0.4.3 • Public • Published

Client side

Init

require(['webrtcio'], function(WebRTCio){
	var WebRTC = WebRTCio.connect(socket, config);
	// or
	var WebRTC = WebRTCio.connect(null, config);
	WebRTC.attach(socket);
});

Methods

  • connect(socket, params)
  • attach(socket)
  • call(clientId)
  • answer(clientId)
  • play()
  • pause()
  • setOptions(options)
  • setOption(key, value)

Events (set in config)

onGetLocalVideo: function (url)
onGetRemoteVideo: function (clientId, url)
onCall: function (clientId)
onError: function (code, text)

Params

  • iceServers
  • video
  • audio

Example config "video"

video: {
	mandatory: {
		maxWidth: 400,
		maxHeight: 300
	},
	optional: [
		{
			minWidth: 120
		},
		{
			minHeight: 90
		},
		{
			maxWidth: 300
		},
		{
			maxHeight: 200
		}
	]
}

Server side

Init

var webRTC = require('webrtcio');
webRTC.attachSocket(socket);

Readme

Keywords

none

Package Sidebar

Install

npm i webrtcio

Weekly Downloads

0

Version

0.4.3

License

MIT

Last publish

Collaborators

  • vaseninm