From b8ac466c90e1cb64faf62fd27863afa503656628 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Fri, 21 Nov 2025 20:17:05 +0100 Subject: [PATCH] Fix issue with Jellyfin using local IP adress not server public URL, now pulic URL is set in plugin. --- .../Channels/SRFPlayChannel.cs | 7 ++++--- .../Configuration/PluginConfiguration.cs | 7 +++++++ .../Configuration/configPage.html | 13 ++++++++++++ .../Controllers/StreamProxyController.cs | 21 +++++++++++++++---- .../Providers/SRFMediaProvider.cs | 13 ++++++++---- .../Services/StreamProxyService.cs | 17 +++++++++++++-- 6 files changed, 65 insertions(+), 13 deletions(-) diff --git a/Jellyfin.Plugin.SRFPlay/Channels/SRFPlayChannel.cs b/Jellyfin.Plugin.SRFPlay/Channels/SRFPlayChannel.cs index c70cbb1..73e08d0 100644 --- a/Jellyfin.Plugin.SRFPlay/Channels/SRFPlayChannel.cs +++ b/Jellyfin.Plugin.SRFPlay/Channels/SRFPlayChannel.cs @@ -476,9 +476,10 @@ public class SRFPlayChannel : IChannel, IHasCacheKey // Register stream with proxy service _proxyService.RegisterStream(itemId, streamUrl); - // Get the server's local API URL so remote clients can access the proxy - // Use the published server address configured in Jellyfin's network settings - var serverUrl = _appHost.GetSmartApiUrl(string.Empty); + // Get the server URL for proxy - prefer configured public URL for remote clients + var serverUrl = !string.IsNullOrWhiteSpace(config.PublicServerUrl) + ? config.PublicServerUrl.TrimEnd('/') // Use configured public URL (important for Android/remote clients) + : _appHost.GetSmartApiUrl(string.Empty); // Fall back to Jellyfin's smart URL resolution // Create proxy URL as absolute HTTP URL (required for ffmpeg) // Use the actual server URL so remote clients can access it diff --git a/Jellyfin.Plugin.SRFPlay/Configuration/PluginConfiguration.cs b/Jellyfin.Plugin.SRFPlay/Configuration/PluginConfiguration.cs index 956f0e4..417ff0c 100644 --- a/Jellyfin.Plugin.SRFPlay/Configuration/PluginConfiguration.cs +++ b/Jellyfin.Plugin.SRFPlay/Configuration/PluginConfiguration.cs @@ -142,4 +142,11 @@ public class PluginConfiguration : BasePluginConfiguration [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "Required for configuration serialization")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1002:Do not expose generic lists", Justification = "Configuration DTO")] public System.Collections.Generic.List EnabledTopics { get; set; } + + /// + /// Gets or sets the public/external server URL for remote clients (e.g., https://jellyfin.example.com:8920). + /// If not set, the plugin will use Jellyfin's GetSmartApiUrl() which may return local addresses. + /// This is important for Android and other remote clients to access streams. + /// + public string PublicServerUrl { get; set; } = string.Empty; } diff --git a/Jellyfin.Plugin.SRFPlay/Configuration/configPage.html b/Jellyfin.Plugin.SRFPlay/Configuration/configPage.html index 8dd623f..1d34e2d 100644 --- a/Jellyfin.Plugin.SRFPlay/Configuration/configPage.html +++ b/Jellyfin.Plugin.SRFPlay/Configuration/configPage.html @@ -82,6 +82,17 @@
Password for proxy authentication (leave empty if not required)
+
+

Network Settings

+
+ + +
+ The public/external URL for remote clients (Android, iOS, etc.) to access streaming proxy. +
If not set, the plugin will use Jellyfin's automatic URL detection which may return local addresses. +
Important for Android/remote playback! +
+