Linux: render video via HTML5 WebView instead of the MPV backend
- online.rs: on Linux, advertise only WebView-decodable codecs (h264 video; aac/mp3/opus/vorbis/flac audio) in PlaybackInfo so Jellyfin transcodes HEVC/AV1/VP9/etc. to h264 HLS for the WebKitGTK <video> element. - player: on Linux, don't load video into MPV (no embedded window — it would start a redundant decode the frontend immediately stops). Add PlayerController::set_current_item to keep queue/UI/remote-transfer state in sync without loading the item into the playback backend.
This commit is contained in:
@@ -411,9 +411,22 @@ pub async fn player_play_item(
|
||||
}
|
||||
|
||||
let controller = player.0.lock().await;
|
||||
// On Linux, video plays in the WebKitGTK HTML5 <video> element (see
|
||||
// get_player_status -> use_html5_element). The MPV backend has no embedded
|
||||
// window, so loading the stream into it would only start a redundant decode
|
||||
// (and the frontend would immediately stop it). Only load into the native
|
||||
// backend on platforms that actually render video through it (e.g. Android).
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
controller
|
||||
.play_item(media_item)
|
||||
.map_err(|e| e.to_string())?;
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
// Keep the queue in sync for UI/remote-transfer without starting MPV.
|
||||
controller
|
||||
.set_current_item(media_item)
|
||||
.map_err(|e| e.to_string())?;
|
||||
}
|
||||
|
||||
// Emit queue changed event
|
||||
controller.emit_queue_changed();
|
||||
|
||||
Reference in New Issue
Block a user