Skip to content

refactor: unify player state into single Status enum#553

Open
theashraf wants to merge 2 commits intomainfrom
refactor/unified-status-enum
Open

refactor: unify player state into single Status enum#553
theashraf wants to merge 2 commits intomainfrom
refactor/unified-status-enum

Conversation

@theashraf
Copy link
Copy Markdown
Member

@theashraf theashraf commented Apr 16, 2026

Summary

  • Replace is_loaded + PlaybackState with a single Status enum (Idle, Playing, Paused, Stopped, Tweening)
  • Expose one status() method instead of is_playing()/is_paused()/is_stopped()/is_loaded()/is_tweening()
  • Update C API, WASM bindings, examples, and tests

Breaking changes (C API)

  • dotlottie_playback_statusdotlottie_status
  • dotlottie_is_loaded removed
  • Enum discriminants: Idle=0, Playing=1, Paused=2, Stopped=3, Tweening=4
  • Semantic shift: Idle is now distinct from Stopped. Previously dotlottie_playback_status returned Stopped both when no animation was loaded and when one was loaded but stopped. Consumers that branched on Stopped to mean "not loaded" now receive Idle for that case and must be updated.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 16, 2026

⚠️ No Changeset found

Latest commit: 4ba4613

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@theashraf theashraf force-pushed the refactor/unified-status-enum branch 2 times, most recently from 4771388 to ad0fa54 Compare April 16, 2026 16:58
- stop() during Tweening now resets resume_status to Stopped so stale
  pre-tween status can't linger past a cancel.
- Add regression test locking in that pause() during Tweening returns
  InsufficientCondition and leaves status at Tweening.
@theashraf theashraf force-pushed the refactor/unified-status-enum branch from 6ee4855 to 4ba4613 Compare April 17, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant