Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed a url fragment issue with web socket url on page load for room …

…hashes

There is an issue on page load when you have a room hash in the url.
You get a url fragment error and the socket connection does not succeed
  • Loading branch information...
commit 654f9e2f98bf7f90f3fa76d0c8896234d0a5e066 1 parent 5864d2b
@mattnull mattnull authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 example/index.html
View
6 example/index.html
@@ -196,8 +196,10 @@
var room = window.location.hash.slice(1);
-
- rtc.connect("ws:" + window.location.href.substring(window.location.protocol.length), room);
+ var url = "ws:"+window.location.href.substring(window.location.protocol.length);
+ var hash = url.indexOf('#');
+ url = (hash !== -1) ? url.substring(0, hash) : url;
+ rtc.connect(url, room);
rtc.on('add remote stream', function(stream, socketId) {
console.log("ADDING REMOTE STREAM...");
Please sign in to comment.
Something went wrong with that request. Please try again.