diff --git a/lib/models/plex_config.dart b/lib/models/plex_config.dart index 5d53b1a9..bc5e4e46 100644 --- a/lib/models/plex_config.dart +++ b/lib/models/plex_config.dart @@ -53,6 +53,7 @@ class PlexConfig { 'X-Plex-Product': product, 'X-Plex-Version': version, 'X-Plex-Platform': platform, + 'X-Plex-Client-Profile-Name': 'Generic', if (device != null) 'X-Plex-Device': device!, if (acceptJson) 'Accept': 'application/json', 'Accept-Charset': 'utf-8', diff --git a/lib/mpv/player/player_native.dart b/lib/mpv/player/player_native.dart index 62a117ae..85874f31 100644 --- a/lib/mpv/player/player_native.dart +++ b/lib/mpv/player/player_native.dart @@ -402,6 +402,12 @@ class PlayerNative implements Player { // Show the video layer await _methodChannel.invokeMethod('setVisible', {'visible': true}); + // Set HTTP headers for Plex authentication and profile + if (media.headers != null && media.headers!.isNotEmpty) { + final headerList = media.headers!.entries.map((e) => '${e.key}: ${e.value}').toList(); + await setProperty('http-header-fields', headerList.join(',')); + } + // Set start position if provided (must be set before loading file) if (media.start != null && media.start!.inSeconds > 0) { await setProperty('start', media.start!.inSeconds.toString());