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:
@@ -859,7 +859,18 @@ impl MediaRepository for OnlineRepository {
|
||||
("h264,hevc".to_string(), "aac,mp3".to_string())
|
||||
});
|
||||
|
||||
#[cfg(not(target_os = "android"))]
|
||||
// Linux desktop plays video through the WebKitGTK HTML5 <video> element,
|
||||
// which cannot reliably decode HEVC/AV1/VP9. Advertise only codecs the
|
||||
// WebView can decode so Jellyfin transcodes anything else to h264 HLS.
|
||||
// (Audio-only files still direct-play via MPV, but the PlaybackInfo
|
||||
// profile is shared, so we keep the broadly-supported audio codecs.)
|
||||
#[cfg(all(not(target_os = "android"), target_os = "linux"))]
|
||||
let (video_codecs, audio_codecs) = (
|
||||
"h264".to_string(),
|
||||
"aac,mp3,opus,vorbis,flac".to_string(),
|
||||
);
|
||||
|
||||
#[cfg(all(not(target_os = "android"), not(target_os = "linux")))]
|
||||
let (video_codecs, audio_codecs) = (
|
||||
"h264,hevc,vp8,vp9,av1,mpeg4".to_string(),
|
||||
"aac,mp3,opus,vorbis,flac".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user