Skip to content

Commit

Permalink
Pause movie after activity suspended
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenghaoz authored and torokati44 committed Jul 1, 2024
1 parent 13563e9 commit 61adec4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,14 @@ async fn run(app: AndroidApp) {
)
.unwrap();
}
player_lock.set_is_playing(true);
}
}
MainEvent::TerminateWindow { .. } => {
let player = &playerbox.as_ref().unwrap().player;
let mut player_lock = player.lock().unwrap();
player_lock.set_is_playing(false);
}
MainEvent::InputAvailable => {
if let Ok(mut inputs) = app.input_events_iter() {
while inputs.next(|input| match input {
Expand Down

0 comments on commit 61adec4

Please sign in to comment.