docs: clarify multi-targeting (.NET 9 and .NET 10) in README build instructions
This commit is contained in:
@@ -60,6 +60,14 @@ namespace JellyfinPlugin
|
||||
return;
|
||||
}
|
||||
|
||||
var isAutoMode = config.PlaybackMode == "Auto" || config.PlaybackMode == "Both";
|
||||
if (isAutoMode && IsJellyfinWebClient(context))
|
||||
{
|
||||
// W trybie Auto dla przeglądarki Web pozwalamy na Direct Play (przycięcie wykona skrypt CSS w przeglądarce).
|
||||
await nextMw().ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// --- HLS STREAM QUERY REWRITE ---
|
||||
// If the client requests the m3u8 playlist, we simply tell Jellyfin NOT to allow video stream copy.
|
||||
// This elegantly forces transcoding for the BEST supported codec without breaking FFmpeg tags/filters!
|
||||
@@ -147,5 +155,43 @@ namespace JellyfinPlugin
|
||||
|
||||
await nextMw().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private static bool IsJellyfinWebClient(HttpContext context)
|
||||
{
|
||||
if (context.Request.Headers.TryGetValue("X-Emby-Authorization", out var authHeader) ||
|
||||
context.Request.Headers.TryGetValue("Authorization", out authHeader))
|
||||
{
|
||||
var authStr = authHeader.ToString();
|
||||
if (authStr.Contains("Client=\"Jellyfin Web\"", StringComparison.OrdinalIgnoreCase) ||
|
||||
authStr.Contains("Client=\"Jellyfin%20Web\"", StringComparison.OrdinalIgnoreCase) ||
|
||||
authStr.Contains("Client=Jellyfin Web", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (context.Request.Headers.TryGetValue("User-Agent", out var uaHeader))
|
||||
{
|
||||
var ua = uaHeader.ToString();
|
||||
if (ua.Contains("JellyfinMediaPlayer", StringComparison.OrdinalIgnoreCase) ||
|
||||
ua.Contains("Jellyfin-Android", StringComparison.OrdinalIgnoreCase) ||
|
||||
ua.Contains("ExoPlayer", StringComparison.OrdinalIgnoreCase) ||
|
||||
ua.Contains("okhttp", StringComparison.OrdinalIgnoreCase) ||
|
||||
ua.Contains("Kodi", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ua.Contains("Mozilla", StringComparison.OrdinalIgnoreCase) ||
|
||||
ua.Contains("Chrome", StringComparison.OrdinalIgnoreCase) ||
|
||||
ua.Contains("Safari", StringComparison.OrdinalIgnoreCase) ||
|
||||
ua.Contains("Firefox", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user