Prevent screen turning off during playback
Closes: #157 XDG portals expose a D-Bus interface allowing apps to prevent screen idling, user switching, and other actions. That interface, org.freedesktop.portal.Inhibit, does all of the heavy lifting here. Idling = the screen dimming or shutting off. Idling is inhibited when a video is actively playing. Idling is NOT inhibited when videos aren't playing - this includes paused or stopped videos.
This commit is contained in:
parent
fa1637fe51
commit
bb087578df
10 changed files with 331 additions and 40 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use cosmic::iced_core::image::Data;
|
||||
use iced_video_player::{Position};
|
||||
use iced_video_player::Position;
|
||||
use image::{DynamicImage, ImageFormat, RgbaImage};
|
||||
use std::{error::Error, num::NonZero, path::Path, time::Duration};
|
||||
use url::Url;
|
||||
|
|
@ -15,7 +15,7 @@ pub fn main(
|
|||
let thumbnails = {
|
||||
let mut video = match video::new_video(input) {
|
||||
Ok(ok) => ok,
|
||||
Err(_err) => return Err(Into::into(format!("missing required plugin")))
|
||||
Err(_err) => return Err(Into::into(format!("missing required plugin"))),
|
||||
};
|
||||
|
||||
let duration = video.duration();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue