1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

SquashSRS4: Refine srs.sdk.js

This commit is contained in:
winlin 2021-05-28 21:44:51 +08:00
parent cc52e5b27c
commit 81bda41b31
7 changed files with 83 additions and 46 deletions

View file

@ -19,7 +19,16 @@
let elems = document.getElementsByClassName('srs_demo');
for (var i = 0; i < elems.length; i++) {
let elem = elems.item(i);
elem.setAttribute('href', elem.getAttribute('href') + '&room=' + roomName);
// Use random room.
let href = elem.getAttribute('href') + '&room=' + roomName;
// For run demos on SRS http server.
if (window.location.port === '8080') {
href += '&wsp=1989';
}
elem.setAttribute('href', href);
}
</script>
</body>