[ipcamera] Change Absolute URLs to Relative so items can be used with HTTPS easier. (#19514)

* Change URLs to be relative and not absolute.

Signed-off-by: Matthew Skinner <matt@pcmus.com>
This commit is contained in:
Matthew Skinner
2025-10-25 14:58:13 +02:00
committed by GitHub
parent aab9732f36
commit 31f8b39fd0
2 changed files with 18 additions and 21 deletions
@@ -702,12 +702,9 @@ public class IpCameraHandler extends BaseThingHandler {
public void startStreamServer() {
servlet = new CameraServlet(this, httpService);
updateState(CHANNEL_HLS_URL, new StringType("http://" + hostIp + ":" + SERVLET_PORT + "/ipcamera/"
+ getThing().getUID().getId() + "/ipcamera.m3u8"));
updateState(CHANNEL_IMAGE_URL, new StringType("http://" + hostIp + ":" + SERVLET_PORT + "/ipcamera/"
+ getThing().getUID().getId() + "/ipcamera.jpg"));
updateState(CHANNEL_MJPEG_URL, new StringType("http://" + hostIp + ":" + SERVLET_PORT + "/ipcamera/"
+ getThing().getUID().getId() + "/ipcamera.mjpeg"));
updateState(CHANNEL_HLS_URL, new StringType("/ipcamera/" + getThing().getUID().getId() + "/ipcamera.m3u8"));
updateState(CHANNEL_IMAGE_URL, new StringType("/ipcamera/" + getThing().getUID().getId() + "/ipcamera.jpg"));
updateState(CHANNEL_MJPEG_URL, new StringType("/ipcamera/" + getThing().getUID().getId() + "/ipcamera.mjpeg"));
}
public void openCamerasStream() {
@@ -1100,16 +1097,16 @@ public class IpCameraHandler extends BaseThingHandler {
public void channelLinked(ChannelUID channelUID) {
switch (channelUID.getId()) {
case CHANNEL_MJPEG_URL:
updateState(CHANNEL_MJPEG_URL, new StringType("http://" + hostIp + ":" + SERVLET_PORT + "/ipcamera/"
+ getThing().getUID().getId() + "/ipcamera.mjpeg"));
updateState(CHANNEL_MJPEG_URL,
new StringType("ipcamera/" + getThing().getUID().getId() + "/ipcamera.mjpeg"));
break;
case CHANNEL_HLS_URL:
updateState(CHANNEL_HLS_URL, new StringType("http://" + hostIp + ":" + SERVLET_PORT + "/ipcamera/"
+ getThing().getUID().getId() + "/ipcamera.m3u8"));
updateState(CHANNEL_HLS_URL,
new StringType("ipcamera/" + getThing().getUID().getId() + "/ipcamera.m3u8"));
break;
case CHANNEL_IMAGE_URL:
updateState(CHANNEL_IMAGE_URL, new StringType("http://" + hostIp + ":" + SERVLET_PORT + "/ipcamera/"
+ getThing().getUID().getId() + "/ipcamera.jpg"));
updateState(CHANNEL_IMAGE_URL,
new StringType("ipcamera/" + getThing().getUID().getId() + "/ipcamera.jpg"));
break;
}
}
@@ -270,7 +270,7 @@
<description>This gives you direct access to specify your own FFmpeg options to be used for animated GIF files.
</description>
<default>-r 2 -filter_complex
scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse</default>
scale=480:-2:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen=max_colors=128:stats_mode=diff[p];[o2][p]paletteuse=dither=bayer:bayer_scale=3</default>
<advanced>true</advanced>
</parameter>
@@ -470,7 +470,7 @@
<description>This gives you direct access to specify your own FFmpeg options to be used for animated GIF files.
</description>
<default>-r 2 -filter_complex
scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse</default>
scale=480:-2:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen=max_colors=128:stats_mode=diff[p];[o2][p]paletteuse=dither=bayer:bayer_scale=3</default>
<advanced>true</advanced>
</parameter>
@@ -736,7 +736,7 @@
<description>This gives you direct access to specify your own FFmpeg options to be used for animated GIF files.
</description>
<default>-r 2 -filter_complex
scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse</default>
scale=480:-2:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen=max_colors=128:stats_mode=diff[p];[o2][p]paletteuse=dither=bayer:bayer_scale=3</default>
<advanced>true</advanced>
</parameter>
@@ -1046,7 +1046,7 @@
<description>This gives you direct access to specify your own FFmpeg options to be used for animated GIF files.
</description>
<default>-r 2 -filter_complex
scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse</default>
scale=480:-2:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen=max_colors=128:stats_mode=diff[p];[o2][p]paletteuse=dither=bayer:bayer_scale=3</default>
<advanced>true</advanced>
</parameter>
@@ -1321,7 +1321,7 @@
<description>This gives you direct access to specify your own FFmpeg options to be used for animated GIF files.
</description>
<default>-r 2 -filter_complex
scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse</default>
scale=480:-2:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen=max_colors=128:stats_mode=diff[p];[o2][p]paletteuse=dither=bayer:bayer_scale=3</default>
<advanced>true</advanced>
</parameter>
@@ -1595,7 +1595,7 @@
<description>This gives you direct access to specify your own FFmpeg options to be used for animated GIF files.
</description>
<default>-r 2 -filter_complex
scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse</default>
scale=480:-2:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen=max_colors=128:stats_mode=diff[p];[o2][p]paletteuse=dither=bayer:bayer_scale=3</default>
<advanced>true</advanced>
</parameter>
@@ -1893,7 +1893,7 @@
<description>This gives you direct access to specify your own FFmpeg options to be used for animated GIF files.
</description>
<default>-r 2 -filter_complex
scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse</default>
scale=480:-2:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen=max_colors=128:stats_mode=diff[p];[o2][p]paletteuse=dither=bayer:bayer_scale=3</default>
<advanced>true</advanced>
</parameter>
@@ -2179,7 +2179,7 @@
<description>This gives you direct access to specify your own FFmpeg options to be used for animated GIF files.
</description>
<default>-r 2 -filter_complex
scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse</default>
scale=480:-2:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen=max_colors=128:stats_mode=diff[p];[o2][p]paletteuse=dither=bayer:bayer_scale=3</default>
<advanced>true</advanced>
</parameter>
@@ -2466,7 +2466,7 @@
<description>This gives you direct access to specify your own FFmpeg options to be used for animated GIF files.
</description>
<default>-r 2 -filter_complex
scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse</default>
scale=480:-2:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen=max_colors=128:stats_mode=diff[p];[o2][p]paletteuse=dither=bayer:bayer_scale=3</default>
<advanced>true</advanced>
</parameter>