diff --git a/lib/webrtc.io.js b/lib/webrtc.io.js index 5b7e3f9..f260996 100644 --- a/lib/webrtc.io.js +++ b/lib/webrtc.io.js @@ -287,6 +287,20 @@ var getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || nav alert('webRTC is not yet supported in this browser.'); } }; + + /** + Syntax sugar for creating a stream + @author Matt Null - http://github.com/mattnull + **/ + rtc.createFullStream = function(onSuccess, onFail) { + this.createStream({video:true, audio:true}, onSuccess, onFail); + }; + rtc.createVideoStream = function(onSuccess, onFail) { + this.createStream({video:true}, onSuccess, onFail); + }; + rtc.createAudioStream = function(onSuccess, onFail) { + this.createStream({audio:true}, onSuccess, onFail); + }; rtc.addStreams = function() { for (var i = 0; i < rtc.streams.length; i++) {