mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 18:09:12 +03:00
[PR #15696] Fix playback of .strm files with internal IPs by enforcing DirectStream #14392
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/15696
Author: @martenumberto
Created: 12/2/2025
Status: 🔄 Open
Base:
master← Head:fix-wrong-ip-behind-nat📝 Commits (1)
c1386a7Fix: Disable Direct Play for .strm files with HTTP URLs to ensure proper playback via proxy📊 Changes
1 file changed (+11 additions, -0 deletions)
View changed files
📝
Emby.Server.Implementations/Library/MediaSourceManager.cs(+11 -0)📄 Description
Describe the bug
Currently,
.strmfiles containing HTTP links to internal resources (e.g., Docker container IPs like172.x.x.x,localhost, or LAN IPs) are treated as "External Media" eligible for Direct Play.When a client (e.g., Android TV, Web) is located outside the server's immediate network (e.g., different VLAN, external access via reverse proxy), it receives the raw internal IP address from the
.strmfile. Since the client cannot reach this private IP directly, playback fails immediately.The Solution
This PR updates
MediaSourceManagerto intelligently detect if a.strmsource URL points to an internal or private network address.Fixes https://github.com/jellyfin/jellyfin/issues/15411
Previously https://github.com/jellyfin/jellyfin/pull/15575
Changes:
INetworkManagerintoEmby.Server.Implementations.Library.MediaSourceManager.GetPlaybackMediaSources, the code now parses the source URL host._networkManager.IsInLocalNetwork(ip)to check if the IP is local. This respects the user's "LAN Networks" configuration in the Jellyfin Dashboard as well as standard RFC1918 private ranges.SupportsDirectPlayis set tofalse. This forces Jellyfin to act as a proxy (typically utilizingffmpeg -c copy/ Direct Stream), making the stream accessible to the client.Testing Done
.strmfile pointing tohttp://172.19.0.4:8080/video.mkv(another container in the same bridge network).http://172...URL and failed to connect..strmfile pointing to a public URL (e.g., a test file on the internet) still utilizes Direct Play.Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.