diff --git a/src/websocket.js b/src/websocket.js index 6665ea3a..8d8a44c0 100644 --- a/src/websocket.js +++ b/src/websocket.js @@ -2,6 +2,7 @@ JSMpeg.Source.WebSocket = (function(){ "use strict"; var WSSource = function(url, options) { this.url = url; + this.options = options; this.socket = null; this.callbacks = {connect: [], data: []}; @@ -34,7 +35,7 @@ WSSource.prototype.start = function() { this.progress = 0; this.established = false; - this.socket = new WebSocket(this.url); + this.socket = new WebSocket(this.url, this.options.protocols || ''); this.socket.binaryType = 'arraybuffer'; this.socket.onmessage = this.onMessage.bind(this); this.socket.onopen = this.onOpen.bind(this);