Skip to content

Playback diagnostics, Events and Error handling#2581

Open
ghenry22 wants to merge 3 commits intodoublesymmetry:mainfrom
ghenry22:pr/playback-diagnostics
Open

Playback diagnostics, Events and Error handling#2581
ghenry22 wants to merge 3 commits intodoublesymmetry:mainfrom
ghenry22:pr/playback-diagnostics

Conversation

@ghenry22
Copy link

Add playback diagnostic events to iOS, Android, and JS layers
iOS:
Add EventType cases: PlaybackStalled, PlaybackErrorLog, PlaybackBufferEmpty, PlaybackBufferFull
Register listeners for new SwiftAudioEx events in TrackPlayer.swift init
Implement handler functions that emit events with track/position/entry data
Android:
Add MusicEvents constants for all four new events
Implement stall detection in MusicService (PLAYING->BUFFERING transition)
Implement buffer empty detection with recovery tracking
JS/TS:
Add Event enum values with JSDoc documentation
Create TypeScript interfaces: PlaybackStalledEvent, PlaybackErrorLogEvent, PlaybackBufferEmptyEvent, PlaybackBufferFullEvent
Wire up EventPayloadByEvent type map for type-safe event handling

Relax SwiftAudioEx version pin to ~> 1.1.0
Allow compatible versions so the Podfile override to the forked SwiftAudioEx resolves without version conflicts.

Add seek completed, playback ended reason events and error position
iOS:
Forward SwiftAudioEx seek and playbackEnd events to JS
Include position in PlaybackError emission
Add PlaybackSeekCompleted and PlaybackEndedWithReason EventType cases
Android:
Collect positionChanged flow for seek completed events
Collect playbackEnd flow for ended reason events
Include position in PlaybackError bundle
Add PLAYBACK_SEEK_COMPLETED and PLAYBACK_ENDED_REASON MusicEvents
JS/TS:
Add PlaybackSeekCompleted and PlaybackEndedWithReason Event enum values
Create PlaybackSeekCompletedEvent and PlaybackEndedWithReasonEvent interfaces
Add position field to PlaybackErrorEvent
Wire new events into EventPayloadByEvent type map
Exclude web/ from tsconfig.build to fix declaration generation

NOTE: Needs the corresponding SwiftAudioEx PR merged to work, or just use the fork of that with this.

ghenry22 and others added 3 commits February 14, 2026 16:03
iOS:
- Add EventType cases: PlaybackStalled, PlaybackErrorLog, PlaybackBufferEmpty, PlaybackBufferFull
- Register listeners for new SwiftAudioEx events in TrackPlayer.swift init
- Implement handler functions that emit events with track/position/entry data

Android:
- Add MusicEvents constants for all four new events
- Implement stall detection in MusicService (PLAYING->BUFFERING transition)
- Implement buffer empty detection with recovery tracking

JS/TS:
- Add Event enum values with JSDoc documentation
- Create TypeScript interfaces: PlaybackStalledEvent, PlaybackErrorLogEvent,
  PlaybackBufferEmptyEvent, PlaybackBufferFullEvent
- Wire up EventPayloadByEvent type map for type-safe event handling

Requires SwiftAudioEx feature/playback-diagnostics branch for iOS support.

Co-authored-by: Cursor <cursoragent@cursor.com>
Allow compatible versions so the Podfile override to the forked
SwiftAudioEx resolves without version conflicts.

Co-authored-by: Cursor <cursoragent@cursor.com>
iOS:
- Forward SwiftAudioEx seek and playbackEnd events to JS
- Include position in PlaybackError emission
- Add PlaybackSeekCompleted and PlaybackEndedWithReason EventType cases

Android:
- Collect positionChanged flow for seek completed events
- Collect playbackEnd flow for ended reason events
- Include position in PlaybackError bundle
- Add PLAYBACK_SEEK_COMPLETED and PLAYBACK_ENDED_REASON MusicEvents

JS/TS:
- Add PlaybackSeekCompleted and PlaybackEndedWithReason Event enum values
- Create PlaybackSeekCompletedEvent and PlaybackEndedWithReasonEvent interfaces
- Add position field to PlaybackErrorEvent
- Wire new events into EventPayloadByEvent type map
- Exclude web/ from tsconfig.build to fix declaration generation

Co-authored-by: Cursor <cursoragent@cursor.com>
@ghenry22 ghenry22 requested a review from dcvz as a code owner February 14, 2026 16:07
@ghenry22 ghenry22 changed the title Pr/playback diagnostics Playback diagnostics, Events and Error handling Feb 14, 2026
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