From b333e32e18daf8a17417bd999592781ffbf07fbe Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Thu, 21 Jun 2018 22:44:25 +1000 Subject: [PATCH] rpicamsrc: webrtc example: Modify HTML to support other ports than 57778 --- tests/examples/rpicamsrc/webrtc-unidirectional-h264.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/examples/rpicamsrc/webrtc-unidirectional-h264.c b/tests/examples/rpicamsrc/webrtc-unidirectional-h264.c index 775db19..9538ede 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 \ -- 2.7.4