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:
@@ -212,6 +212,22 @@ impl PlayerController {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Set the current queue item without loading it into the playback backend.
|
||||
///
|
||||
/// Used on platforms where video is rendered outside the native backend
|
||||
/// (Linux WebKitGTK HTML5 <video>): the queue/UI state must reflect the
|
||||
/// item, but MPV must not start a redundant decode for it.
|
||||
pub fn set_current_item(&self, item: MediaItem) -> Result<(), PlayerError> {
|
||||
debug!("[PlayerController] set_current_item (no backend load): {}", item.title);
|
||||
|
||||
self.reset_autoplay_count();
|
||||
|
||||
let mut queue = self.queue.lock_safe();
|
||||
queue.set_queue(vec![item], 0);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Load and play an item without modifying the queue
|
||||
/// Use this when the queue is already set up and you just want to play a specific item from it
|
||||
pub fn load_and_play(&self, item: &MediaItem) -> Result<(), PlayerError> {
|
||||
|
||||
Reference in New Issue
Block a user