pub async fn player_set_stream_quality(
player: State<'_, PlayerStateWrapper>,
repository_manager: State<'_, RepositoryManagerWrapper>,
video_settings: State<'_, VideoSettingsWrapper>,
repository_handle: String,
quality: StreamingQuality,
use_html5: bool,
current_position: Option<f64>,
media_source_id: Option<String>,
audio_stream_index: Option<i32>,
) -> Result<StreamQualityResponse, String>Expand description
Change the bandwidth ceiling of the video that is playing right now.
A cap is a property of the stream the server is producing, so unlike a volume change it cannot be applied to a stream already in flight — the stream has to be re-opened at the new quality and resumed at the current position. That is the same reload the transcoded-seek and audio-track paths use, and the same two-sided split: HTML5 gets the URL back and reloads its own element, while a native backend is reloaded here.
The change applies to this playback and to everything started afterwards
(it sets the process-wide ceiling), but it is deliberately not persisted:
the in-player picker is a “this film, this connection” control, and the
durable default belongs to Settings. player_set_video_settings is the one
that writes to the database.
TRACES: UR-074 | DR-162