Skip to content

Commit 73fdc06

Browse files
authored
Merge pull request #249 from tobexyz/fix/issue246
fix: fixed pause / stop/play on local player
2 parents f4926a8 + 4b1edba commit 73fdc06

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
KIRO.md
12
reports
23
.kiro
34
doxygen

yaacc/src/main/java/de/yaacc/player/LocalMediaSessionPlayer.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,11 @@ protected void startItem(PlayableItem playableItem, Object loadedItem, int index
285285
player.addMediaItem(builder.build());
286286
}
287287
player.prepare();
288+
} else if (player.getPlaybackState() == Player.STATE_IDLE) {
289+
// Player is IDLE after stop() - need to prepare again
290+
// This happens when play() is called after stop()
291+
YaaccLogger.d(getClass().getName(), "Player in IDLE state, re-preparing before play");
292+
player.prepare();
288293
}
289294
// Now seek and play
290295
player.seekTo(index, 0);
@@ -387,6 +392,8 @@ protected void stopItem(PlayableItem playableItem) {
387392
new Handler(Looper.getMainLooper()).post(() -> {
388393
if (exoPlayer != null) {
389394
exoPlayer.stop();
395+
// Note: ExoPlayer remains in STOPPED state but retains media items and position
396+
// Ready for next play() call (no need to re-prepare unless playlist changed)
390397
}
391398
setPlaying(false);
392399
});

0 commit comments

Comments
 (0)