diff options
author | Jan Schmidt <jan@centricular.com> | 2018-06-21 15:44:25 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2020-07-10 18:46:28 +0300 |
commit | b333e32e18daf8a17417bd999592781ffbf07fbe (patch) | |
tree | 13ff398e93ae17765cd5e5dc3cc076b9bfbbd267 /tests | |
parent | d9115ef1ebe6980781ccbd9697859ec1dbbc14b4 (diff) |
rpicamsrc: webrtc example: Modify HTML to support other ports than 57778
Diffstat (limited to 'tests')
-rw-r--r-- | tests/examples/rpicamsrc/webrtc-unidirectional-h264.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/examples/rpicamsrc/webrtc-unidirectional-h264.c b/tests/examples/rpicamsrc/webrtc-unidirectional-h264.c index 775db19e2..9538ede27 100644 --- a/tests/examples/rpicamsrc/webrtc-unidirectional-h264.c +++ b/tests/examples/rpicamsrc/webrtc-unidirectional-h264.c @@ -132,10 +132,13 @@ const gchar *html_source = " \n \ \n \ \n \ function playStream(videoElement, hostname, port, path, configuration, reportErrorCB) { \n \ - var wsHost = (hostname != undefined) ? hostname : window.location.hostname; \n \ - var wsPort = (port != undefined) ? port : 57778; \n \ + var l = window.location;\n \ + var wsHost = (hostname != undefined) ? hostname : l.hostname; \n \ + var wsPort = (port != undefined) ? port : l.port; \n \ var wsPath = (path != undefined) ? path : \"ws\"; \n \ - var wsUrl = \"ws://\" + wsHost + \":\" + wsPort + \"/\" + wsPath; \n \ + if (wsPort) \n\ + wsPort = \":\" + wsPort; \n\ + var wsUrl = \"ws://\" + wsHost + wsPort + \"/\" + wsPath; \n \ \n \ html5VideoElement = videoElement; \n \ webrtcConfiguration = configuration; \n \ |