Respond to duration changes, fixes #107
This commit is contained in:
parent
0e0718e45d
commit
58c778832b
2 changed files with 7 additions and 1 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -2734,7 +2734,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_video_player"
|
name = "iced_video_player"
|
||||||
version = "0.6.0"
|
version = "0.6.0"
|
||||||
source = "git+https://github.com/jackpot51/iced_video_player.git?branch=prev-cosmic#3f9a1b690a41171d212e79fd6c8488dc9b1b8f4c"
|
source = "git+https://github.com/jackpot51/iced_video_player.git?branch=prev-cosmic#0c669eca4b377544a4df2a47d737c024d36d901c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"glib",
|
"glib",
|
||||||
"gstreamer",
|
"gstreamer",
|
||||||
|
|
|
||||||
|
|
@ -240,6 +240,7 @@ pub enum Message {
|
||||||
Config(Config),
|
Config(Config),
|
||||||
ConfigState(ConfigState),
|
ConfigState(ConfigState),
|
||||||
DropdownToggle(DropdownKind),
|
DropdownToggle(DropdownKind),
|
||||||
|
DurationChanged(Duration),
|
||||||
FileClose,
|
FileClose,
|
||||||
FileLoad(url::Url),
|
FileLoad(url::Url),
|
||||||
FileOpen,
|
FileOpen,
|
||||||
|
|
@ -993,6 +994,10 @@ impl Application for App {
|
||||||
self.dropdown_opt = Some(menu_kind);
|
self.dropdown_opt = Some(menu_kind);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Message::DurationChanged(duration) => {
|
||||||
|
self.duration = duration.as_secs_f64();
|
||||||
|
self.update_mpris_meta();
|
||||||
|
}
|
||||||
Message::FileClose => {
|
Message::FileClose => {
|
||||||
self.close();
|
self.close();
|
||||||
}
|
}
|
||||||
|
|
@ -1414,6 +1419,7 @@ impl Application for App {
|
||||||
|
|
||||||
let mut video_player: Element<_> = VideoPlayer::new(video)
|
let mut video_player: Element<_> = VideoPlayer::new(video)
|
||||||
.mouse_hidden(!self.controls)
|
.mouse_hidden(!self.controls)
|
||||||
|
.on_duration_changed(Message::DurationChanged)
|
||||||
.on_end_of_stream(Message::EndOfStream)
|
.on_end_of_stream(Message::EndOfStream)
|
||||||
.on_missing_plugin(Message::MissingPlugin)
|
.on_missing_plugin(Message::MissingPlugin)
|
||||||
.on_new_frame(Message::NewFrame)
|
.on_new_frame(Message::NewFrame)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue