We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45cd708 commit bbbaf84Copy full SHA for bbbaf84
src/websocket.js
@@ -2,6 +2,7 @@ JSMpeg.Source.WebSocket = (function(){ "use strict";
2
3
var WSSource = function(url, options) {
4
this.url = url;
5
+ this.options = options;
6
this.socket = null;
7
8
this.callbacks = {connect: [], data: []};
@@ -34,7 +35,7 @@ WSSource.prototype.start = function() {
34
35
this.progress = 0;
36
this.established = false;
37
- this.socket = new WebSocket(this.url);
38
+ this.socket = new WebSocket(this.url, this.options.protocols || '');
39
this.socket.binaryType = 'arraybuffer';
40
this.socket.onmessage = this.onMessage.bind(this);
41
this.socket.onopen = this.onOpen.bind(this);
0 commit comments