Skip to content

Commit e2f0fbb

Browse files
committed
Refactor force_root_clip_play to prevent force play from looping.
1 parent 6781cb5 commit e2f0fbb

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

exporter/src/main.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,10 @@ fn take_screenshot(
173173
}
174174

175175
fn force_root_clip_play(player: &Arc<Mutex<Player>>) {
176-
let mut player_guard = player.lock().unwrap();
177-
178-
// Check and resume if suspended
179-
if !player_guard.is_playing() {
180-
player_guard.set_is_playing(true);
181-
}
182-
183-
// Also resume the root MovieClip if stopped
184-
player_guard.mutate_with_update_context(|ctx| {
176+
player.lock().unwrap().mutate_with_update_context(|ctx| {
185177
if let Some(root_clip) = ctx.stage.root_clip() {
186178
if let Some(movie_clip) = root_clip.as_movie_clip() {
187-
if !movie_clip.playing() {
179+
if !movie_clip.playing() && movie_clip.current_frame() < movie_clip.total_frames() {
188180
movie_clip.play();
189181
}
190182
}

0 commit comments

Comments
 (0)