You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<script type="text/javascript" src="statics/jsmpeg-player.umd.min.js"></script>
<script type="text/javascript">
var canvas = document.getElementById('video-canvas');
var url = 'ws://'+document.location.hostname+':8083/ws';
var player = new JSMpeg.Player(url, {canvas: canvas});
</script>
`
The websocket without options.
But the websocket request will have Sec-WebSocket-Protocol: null
For some kind of websocket server: python, golang, etc, I guess the null will send back, which caused chrome refused to make WebSocket connection.
Just make small change if (this.options.protocols != null) { this.socket = new WebSocket(this.url, this.options.protocols); } else { this.socket = new WebSocket(this.url); }
So the null information will gone, it is much easy to used
The text was updated successfully, but these errors were encountered:
Describe the bug
In html
`
` The websocket without options.<script type="text/javascript" src="statics/jsmpeg-player.umd.min.js"></script>
<script type="text/javascript">
var canvas = document.getElementById('video-canvas');
var url = 'ws://'+document.location.hostname+':8083/ws';
var player = new JSMpeg.Player(url, {canvas: canvas});
</script>
But the websocket request will have
Sec-WebSocket-Protocol: null
For some kind of websocket server: python, golang, etc, I guess the null will send back, which caused chrome refused to make WebSocket connection.
Just make small change
if (this.options.protocols != null) { this.socket = new WebSocket(this.url, this.options.protocols); } else { this.socket = new WebSocket(this.url); }
So the null information will gone, it is much easy to used
The text was updated successfully, but these errors were encountered: