Skip to content

Add 'play', 'pause', 'seeked', 'ended' media events & guard - #161

Open
jenna-h wants to merge 1 commit into
MicrosoftEdge:mainfrom
jenna-h:html-media-events
Open

Add 'play', 'pause', 'seeked', 'ended' media events & guard#161
jenna-h wants to merge 1 commit into
MicrosoftEdge:mainfrom
jenna-h:html-media-events

Conversation

@jenna-h

@jenna-h jenna-h commented Aug 17, 2026

Copy link
Copy Markdown

'Play' and 'pause' (not 'playing', 'paused') are the standard names for HTMLMediaEvents: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play_event

Also add:

  • 'Seeked' and 'ended' events.
  • A guard that ensures audio.duration is a valid finite number before calling setPositionState(). This prevents crashing if playback events fire before metadata loads.

This fixes inconsistencies that were observed with system media indicators on Android.

'Play' and 'pause' (not 'playing', 'paused') are the standard names for
HTMLMediaEvents: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play_event

Also add:
- 'Seeked' and 'ended' events.
- A guard that ensures audio.duration is a valid finite number before calling setPositionState(). This prevents crashing if playback events fire before metadata loads.
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