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

Add RTC stream merging demo by FFmpeg. 4.0.97

This commit is contained in:
winlin 2021-05-03 15:53:55 +08:00
parent aa9c4e8604
commit 9fb2b69212
5 changed files with 65 additions and 3 deletions

View file

@ -100,7 +100,6 @@ function SrsRtcSignalingParse(location) {
let wsPort = location.href.split('wsp=')[1];
wsPort = wsPort? wsPort.split('&')[0] : location.host.split(':')[1];
wsHost = wsPort? wsHost.split(':')[0] + ':' + wsPort : wsHost;
let host = location.href.split('host=')[1];
host = host? host.split('&')[0] : location.hostname;
@ -114,6 +113,29 @@ function SrsRtcSignalingParse(location) {
let autostart = location.href.split('autostart=')[1];
autostart = autostart && autostart.split('&')[0] === 'true';
// Remove data in query.
if (query) {
query = query.replace('wss=' + wsSchema, '');
query = query.replace('wsh=' + wsHost, '');
query = query.replace('wsp=' + wsPort, '');
if (room) {
query = query.replace('room=' + room, '');
}
query = query.replace('display=' + display, '');
query = query.replace('autostart=' + autostart, '');
while (query.indexOf('&&') >= 0) {
query = query.replace('&&', '&');
}
query = query.replace('?&', '?');
if (query.lastIndexOf('?') == query.length - 1) {
query = query.substr(0, query.length - 1);
}
}
// Regenerate the host of websocket.
wsHost = wsPort? wsHost.split(':')[0] + ':' + wsPort : wsHost;
return {
query: query, wsSchema: wsSchema, wsHost: wsHost, host: host,
room: room, display: display, autostart: autostart,